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: Joerg Sonnenberger <joerg@xxxxxxxxxxxxxxxxx>
Date: Tue, 3 May 2005 22:06:38 +0200
Mail-followup-to: commits@crater.dragonflybsd.org

On Tue, May 03, 2005 at 10:00:24PM +0200, Jonas Trollvik wrote:
> I dont understand what the difference is between it, is there a good
> place where I can get more information about it?
> -Jonas

The first version uses a static buffer for all threads. That's safe
as long as only one thread uses the function at a time. This can be
done e.g. with explicit locking around the calls.

The second version uses a thread-local buffer, each thread acceses
his own buffer and doesn't collidate with the others.

The problem is, that using locking is perfectly fine, but often not
done. So this is about conforming to standards vs. preventing possible
bugs.

Joerg



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