DragonFly BSD
DragonFly commits List (threaded) for 2005-05
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: cvs commit: src/lib/libc/gen Makefile.inc errlst.c src/lib/libc/i386/sys cerror.S ptrace.S src/lib/libc/sys Makefile.inc __error.c src/lib/libc_r/sys Makefile.inc uthread_error.c src/lib/libc_r/uthread Makefile.inc ...


From: Jonas Trollvik <jontro@xxxxxxxxx>
Date: Tue, 3 May 2005 22:00:24 +0200

I dont understand what the difference is between it, is there a good
place where I can get more information about it?
-Jonas

On 5/3/05, Joerg Sonnenberger <joerg@xxxxxxxxxxxxxxxxx> wrote:
> On Tue, May 03, 2005 at 11:14:59AM -0700, Matthew Dillon wrote:
> >
> > :I'm not sure if we can make e.g. strtok simply thread safe by using
> > :TLS, but I want to use it to get e.g. the resolver fully thread-safe.
> > :This is also the right time to work on our NSS implementation. Once
> > :that works, we can move rpc, yp and perhaps even the resolver out of
> > :libc.
> > :
> > :Joerg
> >
> >     Sure we can:
> >
> > char *
> > strtok(char *s, const char *delim)
> > {
> >     static char *last;
> >
> >     return strtok_r(s, delim, &last);
> > }
> >
> >     To
> >
> > char *
> > strtok(char *s, const char *delim)
> > {
> >     __thread static char *last;
> >
> >     return strtok_r(s, delim, &last);
> > }
> >
> >     Poof.  Thread safe.
> 
> But with a different semantic in a threaded environment.
> That's why we have to be a bit careful. Unlikely to be a
> problem here, but something we have to keep in mind.
> 
> Joerg
>




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