How can Unix pipes be used between main process and thread?

前端 未结 5 654
慢半拍i
慢半拍i 2021-01-05 08:31

I am trying to channel data via pipes whenever a signal arrives from a thread to the main process.

Is this possible?
How can this be done?


The pr

5条回答
  •  轮回少年
    2021-01-05 08:47

    It can be done, but it's rather unnecessary. Pipes are intended for inter-process communication. Threads share the same memory and can therefore communicate directly, as long as you use locking correctly.

提交回复
热议问题