The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
.
google unix.com



High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Mutex in Perl superuser84 Shell Programming and Scripting 6 11-13-2007 12:55 AM
what is diff b/w semaphore and mutex amitpansuria UNIX for Dummies Questions & Answers 1 08-21-2007 02:45 AM
how to lock keyboard without using lock command dianayun UNIX for Dummies Questions & Answers 7 06-21-2002 07:05 PM
mutex sagar UNIX for Dummies Questions & Answers 2 02-04-2002 06:00 PM
Threads and Mutex vthasan High Level Programming 2 11-02-2001 07:34 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 03-20-2006
satheeshalle satheeshalle is offline
Registered User
  
 

Join Date: Dec 2005
Posts: 4
How to handle mutex lock?

Hi, I have two tasks 'Read' and 'Write' which reads and writes on a file "abc.txt" respectively.
Now I need to restrict the Write operation on the file while Read is going on, But can allow two Reads at a time.
ie. two Reads can happen simultaneously, but Write can't happen at Read is going on.

I can do this by using Mutex lock which can lock the file at the start of Read and release after completion of Read, But by doing this the second Read will also won't get access to the file.

Can anybody have idea, how to handle this?

Thanks in advance.

Cheers
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 07:45 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0