Re: fork and process timing issue
From: Barry Margolin (barmar_at_alum.mit.edu)
Date: 05/29/04
- Next message: Nick Landsberg: "Re: fork and process timing issue"
- Previous message: Stephen: "Re: fork and process timing issue"
- In reply to: Stephen: "Re: fork and process timing issue"
- Next in thread: Nick Landsberg: "Re: fork and process timing issue"
- Reply: Nick Landsberg: "Re: fork and process timing issue"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 28 May 2004 21:17:30 -0400
In article <40B7D47E.8060802@foo>, Stephen <s@foo> wrote:
> Barry Margolin wrote:
> > In article <40B75D67.EFBCFAEC@cast-com.net>,
> > "Stephen L." <sdlnospamar@cast-com.net> wrote:
>
> [ snip ]
>
> >>
> >>Huh? How can an `execv()'d program (process "B")
> >>access memory in it's parent (process "A")?
> >>
> >>If "A" stores the child's PID in an array, how
> >>is "B" seeing this value? There's something
> >>missing in you problem description.
> >
> >
> > The array is probably in a shared memory segment. This detail isn't
> > really relevant to the OP's question.
> >
>
> Yup, it is (relevant, IMHO). Unless he's putting the pid
> in a _file_ (or some more complex scheme), the following is TRUE ->
>
> Any shared memory segments attached to the calling process
> image will not be attached to the new process image (see
> shmop(2)).
I was assuming that the program he's exec'ing calls shmat() to access
the shared memory.
He said that his program used to work before he got faster hardware. So
obviously the stuff involving this array does what he wants. The only
thing that has changed is the timing, and that's not related to what the
applications do. For whatever reason, he wants the parent process to
perform certain actions before the child does some related actions, and
the solution to this is to use some method of signaling between the
processes: a semaphore, a pipe, etc.
-- Barry Margolin, barmar@alum.mit.edu Arlington, MA *** PLEASE post questions in newsgroups, not directly to me ***
- Next message: Nick Landsberg: "Re: fork and process timing issue"
- Previous message: Stephen: "Re: fork and process timing issue"
- In reply to: Stephen: "Re: fork and process timing issue"
- Next in thread: Nick Landsberg: "Re: fork and process timing issue"
- Reply: Nick Landsberg: "Re: fork and process timing issue"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|