1

I am working on a project of multi-client server chatting using socket programming based on C. I want to make a thread notify the main thread after it has finished: but I don't want the main thread to wait until that( the child thread) is finished.

Semere Gr
  • 31
  • 2

1 Answers1

1

Use a C pipe.

The child thread writes to the pipe if data are available. The main thread can wait on the pipe to get notified.

If you want the main thread to process other data in between, then let these other input data notify the main thread via the same pipe.

Christian Heller
  • 140
  • 2
  • 10