Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How to use CompletionPort to exchange data between two threads

How to use CompletionPort to exchange data between two threads

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    Electronic75
    wrote on last edited by
    #1

    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.

    R 1 Reply Last reply
    0
    • E Electronic75

      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.

      R Offline
      R Offline
      Roger Stoltz
      wrote on last edited by
      #2

      Read this excellent article[^].

      "It's supposed to be hard, otherwise anybody could do it!" - selfquote
      "High speed never compensates for wrong direction!" - unknown

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups