Inter-thread communication (worker threads)

后端 未结 4 572
轻奢々
轻奢々 2021-01-24 13:05

I\'ve created two threads A & B using CreateThread windows API. I\'m trying to send the data from thread A to B.

I know I can use Event object and wait for the Event

4条回答
  •  鱼传尺愫
    2021-01-24 13:57

    Don´t use a mutexes when only working in one single process, beacuse it has more overhead (since it is a system-wide defined object)... Place a critical section around Your data and try to enter it (as Jerry Coffin did in his code around for the thread safe queue).

提交回复
热议问题