home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.programmer
- Path: sparky!uunet!europa.asd.contel.com!darwin.sura.net!jvnc.net!nuscc!nusunix3.nus.sg!isc40038
- From: isc40038@nusunix1.nus.sg (LIM FANG HOW)
- Subject: How to implement mandatory locking
- Message-ID: <1992Nov24.022327.2307@nuscc.nus.sg>
- Sender: usenet@nuscc.nus.sg
- Organization: National University of Singapore
- X-Newsreader: TIN [version 1.1 PL6]
- Date: Tue, 24 Nov 1992 02:23:27 GMT
- Lines: 14
-
- I am working on a interprocess communication project. It consists of a
- set of concurrent processes accessing a set of files. To achieve
- consistency, I had tried to use advisory locking with the following
- command :
- for (x=1;x<=2000;++x) {
- if ((flock(fd,LOCK_EX|LOCK_NB))==-1)
- print error messages;
- else break;
- }
-
- However, it gives me a deadlock situation.
-
- Thank you all.
-
-