IPC thread question

This is a discussion on IPC thread question within the C Programming forums, part of the General Programming Boards category; i'm currently doing sample questions to practice for my exam, and one of the questions about IPC(Inter process communication) stated ...

IPC thread question

i'm currently doing sample questions to practice for my exam, and one of the questions about IPC(Inter process communication) stated that processes need to communicate to:
1. pass some information
2. so as to not interfere with on another when accessing shared resources
3. to ensure proper sequencing of dependent activities
the question asks the last two relates to threads, why not the first one?

the question asks the last two relates to threads, why not the first one?

Because threads are not independent processes. They do not need to pass any information between themselves -- their information namespace is already shared globally, the same way it is in a normal, single threaded program. So #1 is not an issue.

However, because they run concurrently, how they access global information and resources is an issue, and one solution is to use a sort of IPC, such as semaphores. This isn't really "inter-process" communication, but it functions identically (since semaphores can be used for real IPC).