httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick Kew <...@apache.org>
Subject Re: Writing a monitoring thread in apache filter moudle
Date Sun, 20 Apr 2014 11:13:12 GMT

On 20 Apr 2014, at 09:05, Hassan Monfared wrote:

> Dear members,
> I have global static array in my module

What do you mean by a global static array?

In normal operation, apache runs multi-process.
So what looks like global static is actually per-process.
Think that through and it'll probably tell you what's wrong.

> I wrote a monitoring thread with boost::thread which runs in background and
> updates the list every 5 seconds.

You'd probably be better off with apr threads: two separate
threading models will add complexity and detract from
portability and maintainability.

Either run the update per-process or use shared memory.
In the latter case, use apache's (and apr's) mechanisms
for shared memory and timed monitoring to avoid introducing
new complexity.

-- 
Nick Kew

Mime
View raw message