public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Lee Revell <rlrevell@joe-job.com>
To: Roland Kuhn <rkuhn@e18.physik.tu-muenchen.de>
Cc: Arjan van de Ven <arjan@infradead.org>,
	lgb@lgb.hu, linux-kernel@vger.kernel.org
Subject: Re: OT: fork(): parent or child should run first?
Date: Wed, 11 Jan 2006 12:11:53 -0500	[thread overview]
Message-ID: <1136999513.27255.45.camel@mindpipe> (raw)
In-Reply-To: <4653C70B-04C2-4165-A073-24C6CD21214E@e18.physik.tu-muenchen.de>

On Wed, 2006-01-11 at 14:34 +0100, Roland Kuhn wrote:
> Hi Arjan!
> 
> On 11 Jan 2006, at 13:51, Arjan van de Ven wrote:
> 
> > you just cannot depend on which would run first, child or parent. Even
> > if linux would do it the other way around, you have no guarantee.  
> > Think
> > SMP or Dual Core processors and time slices and cache misses... your
> > code just HAS to be able to cope with it. Even on solaris ;)
> 
> That means that the starting of the child process needs to be  
> synchronized by the application itself. I tried it once but then I  
> discovered that my case was easily solved in a completely different  
> way (it was a very small project). However, which one is the easiest/ 
> fastest way to do this synchronization? Using SysV-Semaphores? Pipes?  
> Would something like this work?

How about POSIX process-shared mutexes?  There's no documentation
avalable on using them with Linux (where are the NPTL man pages
already?) but they work.

Lee


  reply	other threads:[~2006-01-11 17:11 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-11 12:37 OT: fork(): parent or child should run first? Gábor Lénárt
2006-01-11 12:51 ` Arjan van de Ven
2006-01-11 13:02   ` Gábor Lénárt
2006-01-11 13:25     ` Bernd Petrovitsch
2006-01-11 13:49       ` Ian Campbell
2006-01-11 13:55         ` Bernd Petrovitsch
2006-01-11 14:05           ` Ian Campbell
2006-01-11 15:19             ` linux-os (Dick Johnson)
2006-01-12  1:33           ` David Schwartz
2006-01-12  1:38     ` Kurt Wall
2006-01-12 17:23       ` Hugh Dickins
2006-01-12 20:19         ` Gábor Lénárt
2006-01-11 13:34   ` Roland Kuhn
2006-01-11 17:11     ` Lee Revell [this message]
2006-01-11 13:03 ` Miquel van Smoorenburg
2006-01-11 13:08 ` Jan-Benedict Glaw
2006-01-12  1:33 ` David Schwartz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1136999513.27255.45.camel@mindpipe \
    --to=rlrevell@joe-job.com \
    --cc=arjan@infradead.org \
    --cc=lgb@lgb.hu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rkuhn@e18.physik.tu-muenchen.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox