FTDI Community

General Category => Discussion - Drivers => Topic started by: Coderitter GmbH on June 26, 2023, 02:42:39 PM

Title: Concurrently using FT_WritePipe and FT_ReadPipe within their own threads
Post by: Coderitter GmbH on June 26, 2023, 02:42:39 PM
1. Is it allowed to have 2 threads, one writing with synchronous FT_WritePipe and the other reading with synchronous FT_ReadPipe?

2. Will synchronous FT_WritePipe in one thread be blocked by synchronous FT_ReadPipe in the other thread and vice verca?

3. Is it allowed to have 2 threads, one writing with asynchronous FT_WritePipe and the other reading with asynchronous FT_ReadPipe?
Title: Re: Concurrently using FT_WritePipe and FT_ReadPipe within their own threads
Post by: Coderitter GmbH on July 04, 2023, 12:34:14 PM
> 1. Is it allowed to have 2 threads, one writing with synchronous FT_WritePipe and the other reading with synchronous FT_ReadPipe?
[Ans] Yes. In fact, write and read should have independent threads.
 
> 2. Will synchronous FT_WritePipe in one thread be blocked by synchronous FT_ReadPipe in the other thread and vice verca?
[Ans]. No.

> 3. Is it allowed to have 2 threads, one writing with asynchronous FT_WritePipe and the other reading with asynchronous FT_ReadPipe?
[Ans] It is recommended to have independent threads for read and write.