Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.os.linux.development.apps > #55
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!news2.arglkargh.de!news.musoftware.de!wum.musoftware.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail |
|---|---|
| From | Rainer Weikusat <rweikusat@mssgmbh.com> |
| Newsgroups | comp.os.linux.development.apps |
| Subject | Re: mkdir() and thread safety() |
| Date | Wed, 30 Mar 2011 15:44:40 +0100 |
| Lines | 23 |
| Message-ID | <878vvw652f.fsf@sapphire.mobileactivedefense.com> (permalink) |
| References | <9d56213c-a054-428e-866c-559da29fbbc3@o21g2000prh.googlegroups.com> <2d58ece6-bb9c-42e0-a990-fc13b92723ec@a21g2000prj.googlegroups.com> <87oc4vtn8o.fsf@sapphire.mobileactivedefense.com> <616f7ca6-9853-4c8d-af92-983ca41365e6@g3g2000prg.googlegroups.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=iso-8859-1 |
| Content-Transfer-Encoding | 8bit |
| X-Trace | individual.net lugVa/7U+oQG0k9iT+mm+gs3f+LmnTU0q7cWWy7xcLm3wQLt8= |
| Cancel-Lock | sha1:GHfD8qIZqB5qNn1q3NDS6Rc5ehM= sha1:hhlIy7q8mfHXj1qlTSTo5efcjSA= |
| User-Agent | Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) |
| Xref | x330-a1.tempe.blueboxinc.net comp.os.linux.development.apps:55 |
Show key headers only | View raw
mkaushik <mayank.utexas@gmail.com> writes: > On Mar 28, 5:59 am, Rainer Weikusat <rweiku...@mssgmbh.com> wrote: >> David Schwartz <dav...@webmaster.com> writes: >> > On Mar 25, 5:56 pm, mkaushik <mayank.ute...@gmail.com> wrote: >> >> I have two threads, each tries to create a directory of the same name >> >> at the same location using mkdir(). The threads need to be oblivious >> >> of each others' existence. Do I have to worry about concurrency when I >> >> use mkdir() to create this directory? Or will mkdir() always return >> >> success in one thread and EEXIST in the other? [...] > Thanks for the answers everyone! Something which hasn't been mentioned explicitly so far: It is possible that both calls fail with EEXIST despite one created the directory: Provided that some kind of network filesystem with a stateless server is being used (IOW, NFS). It is possible that the server crashes after it created the directory but before it could send a reply to the client which requested the action. Once the server is again available, the retransmitted 'create this directory' requests from the client should lead to EEXIST.
Back to comp.os.linux.development.apps | Previous | Next — Previous in thread | Find similar
Re: mkdir() and thread safety() mkaushik <mayank.utexas@gmail.com> - 2011-03-30 00:37 -0700 Re: mkdir() and thread safety() Rainer Weikusat <rweikusat@mssgmbh.com> - 2011-03-30 15:44 +0100
csiph-web