How to use CompletionPort to exchange data between two threads
-
Hello, I read the MSDN but there were no example and I didn't completely understand how to use it. I have two threads that both send data to the other thread and receive data from it. Should I create IoCompletionPort in both threads and use ReadFileEx and WriteFileEx t read and write to/from the i/o completion port? I'm confused because in MSDN has said that one shuld not use ReadFileEx & WriteFileEx. It says "After an instance of an open file is associated with an I/O completion port, it cannot be used in the ReadFileEx or WriteFileEx function." Then How should I read and write to I/O Completion port? I'm confused:confused: can someone explain a bit please. thanks.
-
Hello, I read the MSDN but there were no example and I didn't completely understand how to use it. I have two threads that both send data to the other thread and receive data from it. Should I create IoCompletionPort in both threads and use ReadFileEx and WriteFileEx t read and write to/from the i/o completion port? I'm confused because in MSDN has said that one shuld not use ReadFileEx & WriteFileEx. It says "After an instance of an open file is associated with an I/O completion port, it cannot be used in the ReadFileEx or WriteFileEx function." Then How should I read and write to I/O Completion port? I'm confused:confused: can someone explain a bit please. thanks.
Read this excellent article[^].
"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"High speed never compensates for wrong direction!" - unknown