Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 05 Feb 1998 21:48:42 +1030
From:      Mike Smith <mike@smith.net.au>
To:        Graham Wheeler <gram@cdsec.com>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: Shared memory and signals 
Message-ID:  <199802051118.VAA00292@word.smith.net.au>
In-Reply-To: Your message of "Sat, 02 Feb 1998 17:41:35 %2B0200." <199802021541.RAA07701@cdsec.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
> I was wondering whether it is safe to call shmdt and shmctl from within
> a signal handler. I have a program which forks off child processes which
> communicate their results back using a shared memory segment. I would like
> the parent to detach and release the shared memory from within the SIGCHLD
> signal handler, but I'm not sure whether this is safe.

Can you do this more cleanly by calling wait4?  Unless you are sleeping 
on something inside the segment, I can't *think* of any reentrancy/
locking issues, but I would be worried about the locking you'd have to 
apply around the other datastructures that your handler might be accessing.

-- 
\\  Sometimes you're ahead,       \\  Mike Smith
\\  sometimes you're behind.      \\  mike@smith.net.au
\\  The race is long, and in the  \\  msmith@freebsd.org
\\  end it's only with yourself.  \\ 





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199802051118.VAA00292>