![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Mutex in Perl | superuser84 | Shell Programming and Scripting | 6 | 11-12-2007 08:55 PM |
| what is diff b/w semaphore and mutex | amitpansuria | UNIX for Dummies Questions & Answers | 1 | 08-20-2007 10:45 PM |
| mutex in shell programing | zz_xm | Shell Programming and Scripting | 1 | 03-09-2005 06:53 PM |
| mutex | sagar | UNIX for Dummies Questions & Answers | 2 | 02-04-2002 02:00 PM |
| Threads and Mutex | vthasan | High Level Programming | 2 | 11-02-2001 03:34 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
difference between Mutex and semaphores
Hi,
can someone explain me the difference between mutex and semaphores? Thanks |
| Forum Sponsor | ||
|
|
|
|||
|
They are the same data type, and both work as locks or in-memory flags to control access to some object like shared memory or protected code segments.
semaphores may have values 0 -> n where n is an arbitrary number, like 10, or 4. A mutex has two values either set = 1 or not set = 0. mutexes are typically acted upon by special functions, particularly in the pthreads library. Local event flags are the most common example of sempahore use. Mutexes are used extensively in threads programming, for example. |
|||
| Google The UNIX and Linux Forums |