Re: [Nagios-devel] Less is More (Threading)
Posted: Thu Aug 20, 2009 7:57 am
Steven D. Morrey wrote:
> So I've implemented multi-threading in the main event loop to force
> high priority events to no longer block the main thread. It turned
> out to be brain dead simple to implement. That has me a bit worried
> actually.
>
> After going through the source line by line, I see no place where
> event_list_low and event_list_high could stomp on eachother, ergo no
> need for mutexes, semaphores etc, anywhere that I was able to find.
>
> The fix I followed was simply to cut the event list high code out and
> paste it into it's own function then perform a pthread_create right
> before we enter the main event loop. So now we have 2 threads where
> once there was only one. This appears to be working well, and my
> latencies are dropping quickly.
>
> If it continues to drop and tends to stay that way I'll get a patch
> up, but in the meantime, is there any place those 2 threads could
> take eachothers cookies so to speak?
>
It can potentially result in passive checks for a failing service
being parsed before a host check is executed, leading to a service
notification being sent out even if the host is actually down.
Though come to think of it, that could've happened before too, so
it shouldn't be much of an issue.
I'd be very interested in seeing the patch though.
--
Andreas Ericsson [email protected]
OP5 AB www.op5.se
Tel: +46 8-230225 Fax: +46 8-230231
Considering the successes of the wars on alcohol, poverty, drugs and
terror, I think we should give some serious thought to declaring war
on peace.
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
> So I've implemented multi-threading in the main event loop to force
> high priority events to no longer block the main thread. It turned
> out to be brain dead simple to implement. That has me a bit worried
> actually.
>
> After going through the source line by line, I see no place where
> event_list_low and event_list_high could stomp on eachother, ergo no
> need for mutexes, semaphores etc, anywhere that I was able to find.
>
> The fix I followed was simply to cut the event list high code out and
> paste it into it's own function then perform a pthread_create right
> before we enter the main event loop. So now we have 2 threads where
> once there was only one. This appears to be working well, and my
> latencies are dropping quickly.
>
> If it continues to drop and tends to stay that way I'll get a patch
> up, but in the meantime, is there any place those 2 threads could
> take eachothers cookies so to speak?
>
It can potentially result in passive checks for a failing service
being parsed before a host check is executed, leading to a service
notification being sent out even if the host is actually down.
Though come to think of it, that could've happened before too, so
it shouldn't be much of an issue.
I'd be very interested in seeing the patch though.
--
Andreas Ericsson [email protected]
OP5 AB www.op5.se
Tel: +46 8-230225 Fax: +46 8-230231
Considering the successes of the wars on alcohol, poverty, drugs and
terror, I think we should give some serious thought to declaring war
on peace.
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]