Re: OT: fork(): parent or child should run first?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux