c - Does message queue support Multi-thread? -


i have 3 questions thread , process communication.

  1. 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)?

  2. can semop() function used synchronize threads in 1 process?

  3. 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

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -