FreeBSD and threads in 3.0

Oriol Capsada oriolc at voztele.com
Wed Sep 12 12:24:04 CEST 2007


Andreas Ericsson wrote:
> Oriol Capsada wrote:
>   
>> Hi all,
>>
>> I have seen that in the "What's new" section of the 3.x documentation 
>> the "known issue" with FreeBSD and threads that appeared in the 2.x 
>> documentation is there no more.
>>
>> Does anyone know if that problem with FreeBSD and threads is solved in 
>> the 3.0 version? And if it's not, should the known issue announcement be 
>> added again in the 3.x documentation?
>>     
>
>
> Judging by the code, it appears to be solved.
>
> The problem was that nagios used fork() in a subthread of the main process.
> There are a plethora of various resource contention problems associated
> with that behaviour, and the various standards controlling commonly used
> C api's leave a lot of the reactions to some of the subtler errors listed
> as "undefined", or "implementation specific", which means it *might* work,
> and most likely usually will, but in the long run (over 50k+ iterations),
> you run into "undefined behaviour". This "undefined behaviour" usually means
> (in C, when threads are in the picture) either a segfault or an infinite
> loop in the form of a spinlock on some locked-and-never-released resource.
>
> >From what I can see in the code, this behaviour is now scrapped, and Nagios
> uses temporary files to transfer status from an executed check to the
> master process. This has its problems too, but the symptoms of those problems
> rarely (if ever) cause programs to crash completely, and the errors are
> much more pleasant to debug than the once-every-50k-iteration kind, which
> can, literally take *weeks* to trigger.
>
>   
These are very good news! :)

Thanks a lot for your clear explanation Andreas.

Regards,
Oriol.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/




More information about the Developers mailing list