On Sat, Jan 8, 2011 at 00:06, Neil McKee <neil.mc...@inmon.com> wrote: > This module is designed to work in both "prefork" and "worker" models. I > would really > appreciate it if someone could review the design to make sure I made > appropriate choices > about where to use pipes, shared-memory, mutex locking, and so on(!) These > choices > are documented in the comment at the top of the mod_sflow.c file, here: > http://code.google.com/p/mod-sflow/source/browse/trunk/mod_sflow.c?r=14
Neil, two points of critique: 1. You are doing way too much in your critical section, including potentially blocking actions like logging. 2. Assuming it's safe to write up to 4K to the pipe is dangerous for several reasons: PIPE_BUF may be < 4096, the pipe may not be empty, etc. This ties in with #1 since you are doing it from within the critical section.