c - Does message queue support Multi-thread? -
i have 3 questions thread , process communication.
can linux function msgget(), msgsnd(), , msgrcv() invoked multiple threads in 1 process? these functions in different threads attempt access(r/w) 1 process' message queue. race conditions supposed taken care system? if not, there method support threads , send message main thread(process)?
can semop() function used synchronize threads in 1 process?
there shared memory have following entities access.
- process
- several threads in 1 process. have use semaphore of inter-process level , semaphore of threads level at same time? simple way handle this?
a lot of question. :) thanks.
can linux function msgget(), msgsnd(), , msgrcv() invoked multiple threads in 1 process?
you not need worry race conditions, system take care of that, there no race condition these calls.
can semop() function used synchronize threads in 1 process?
yes, read more in documentation
do have use semaphore of inter-process level , semaphore of threads level?
any resource shared globally among threads or processes subject race conditions due 1 or more threads or processes trying access @ same time, need synchronize access such shared global resource.
Comments
Post a Comment