6.2-Release and Clamd 0.90 with libpthread.so

Daniel Eischen deischen at freebsd.org
Wed Feb 21 05:03:19 UTC 2007


On Wed, 21 Feb 2007, Martin Blapp wrote:

>> Sigh,
>> 
>>> 
>>> Useing daemon(3) instead of fork seems to fix the problem.
>> 
>> Of course deamon(3) calls fork, and after a short time I
>> had again the same ktrace output and CPU usage.
>
> Using daemon(3) works some times, but from time to time
> I see then again the old behaviour, looping kse calls
> and some forks().
>
> I wonder why those calls never happen in the libthr
> and libc_r cases.

libc_r and libthr don't have to kse initialization and
have different locking.

Regardless, I think the code (clamd) is wrong.  There
is no guarantee that fork() from threaded application
will work for libthr and libc_r either.  If clamd needs
to daemonize, it can always exec() itself with an added
argument that means "I've already fork()'d, don't fork()
again".

-- 
DE


More information about the freebsd-threads mailing list