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?
I've looked through my lecture notes but couldn't find an answer, can anyone please help?
Because threads and processes run independently and cannot directly pass information between themselves.
The hint is in #2... shared resources.
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.
Originally Posted by Izzy123
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).