On Fri, Aug 08, 2003 at 02:06:13PM +0200, Jeroen Dekkers wrote:
> On Thu, Aug 07, 2003 at 11:48:41PM +0200, Marco Gerards wrote:
> > Already tried to use an argp parser, and that worked. Unfortunately
> > there were issues with the argp parser, argp isn't reentrant. (I guess
> > I was lucky when I used it).
> 
> Hmm, I don't see a reason why this wouldn't work. The problem is when
> different threads use argp at the same time, but this can't happen
> with the locks protecting argp. These locks are recursive, recursively
> calling argp doesn't cause a deadlock.

The comment in argp-parse.c is:

   If we can, we regulate access to getopt, which is non-reentrant, with a
   mutex.  Since the case we're trying to guard against is two different
   threads interfering, and it's possible that someone might want to call
   argp_parse recursively (they're careful), we use a recursive lock if
   possible. 
 
I wonder what this "they're careful" means.

Thanks,
Marcus

-- 
`Rhubarb is no Egyptian god.' GNU      http://www.gnu.org    [EMAIL PROTECTED]
Marcus Brinkmann              The Hurd http://www.gnu.org/software/hurd/
[EMAIL PROTECTED]
http://www.marcus-brinkmann.de/


_______________________________________________
Bug-hurd mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-hurd

Reply via email to