Passing Data between thread using C issue

后端 未结 2 1539
臣服心动
臣服心动 2021-01-12 18:48

I want know how to pass data between threads using C language.

For example:X waits for a message from somewhere.
Y sends T-X a message about an

2条回答
  •  执笔经年
    2021-01-12 19:45

    Threads are sharing the same memory space so you can use ordinary variable to share data between threads.

    You are also mentioning about thread waiting for some event, this is another story - synchronization. For this purpose you can use mutexses for example.

提交回复
热议问题