![]() |
|
|
|||||||
| Home | Forums | Register | Rules & FAQ | 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. |
Other UNIX.COM Threads You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| read and write from a file | rinku | Shell Programming and Scripting | 2 | 01-10-2008 09:22 PM |
| how i write script to create 30 processes | amitpansuria | UNIX for Advanced & Expert Users | 2 | 10-20-2007 02:45 AM |
| Problem with read & write | EltonSky | High Level Programming | 11 | 08-31-2006 11:35 AM |
| popening for read and write | szzz | High Level Programming | 1 | 11-18-2003 08:05 AM |
| read, write & STDOUT_FILENO.... | M3xican | High Level Programming | 2 | 07-17-2002 01:41 PM |
![]() |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
Read/write locks within and between processes. Can you help?
I have an application that is multithreaded and concurrent. Multiple instances of the application must run at the same time.
Each thread in each process accesses shared resources. For this purpose I've employed Butenhof's read-write locks. Inter-process locking is based on fcntl. For example, fcntl is used to prevent a reader from process 1 getting access to a resource that was write locked by a thread from process 2. I am not sure that this implementation is watertight. Do you know of a "standard" implementation for this kind of mutex? Do you know of another way to implement this kind of locking? Cheers, Adam |
| Forum Sponsor | ||
|
|
|
|||
|
Quote:
|
|
|||
|
An exclusive lock is supposed to stop all other access types, by definition.
You have the right model. It's usually the one implemented for shared memory access across processes - System V semaphores. Normally, there are two semphores (mutexes). See Section 5.2 Process Semaphores in: http://www.advancedlinuxprogramming....p-ch05-ipc.pdf |
|||
| Google UNIX.COM |