Subj : Re: share a exclusive resource between the threads inside the different processes To : comp.programming.threads From : steve Date : Wed Mar 23 2005 03:19 pm In article , Hank wrote: >Hi, > >Is is possible to share a exclusive resource between the threads inside the >different processes? >For example: ( In linux platform with POSIX thread ) >have 3 processes and each contain 3 threads , in other words there are 9 >threads inside the different processes >how these threads can access the resource synchronously? >mutex? semaphore? locking file? or.......... What's the resource? Different resources have different techniques available, and in some cases, you don't need to worry about it at all. Depending on which glibc+kernel version you have, it may be possible to use mutexes with the pshared attribute set. Or semaphores. I would tend to avoid file locks because of some ... unusual ... design choices made in POSIX (threads in a single process need to use something besides file locks for mutual exclusion). -- Steve Watt KD6GGD PP-ASEL-IA ICBM: 121W 56' 57.8" / 37N 20' 14.9" Internet: steve @ Watt.COM Whois: SW32 Free time? There's no such thing. It just comes in varying prices... .