hi,

After r1201149, we now lock for lots of things, where in an ideal
case, we shouldn't need it.

I'm toying around with ideas on how to eliminate the need for a mutex at all.

My current 'best' idea I think:

1) Create a new struct, ap_pollset_operation_and_timeout_info_t, which
contains a what pollset operation to do (Add, Remove, Flags),
timeout_type, the timeout value, and a pointer to the conn_rec.

2) Implement a single-reader single writer circular ring buffer of
these structures. (Using 2x uint16_t head/end offsets stuffed into a
single uint32_t so we can make it portability atomic using
apr_atomic_cas32)

3) Allocate this ring buffer per-worker.

4) Have the single Event thread de-queue operations from all the worker threads.

This would remove the 4 or 5 separate timeout queues we have
developed, and their associated mutex, and basically move all of the
apr_pollset operations to the single main thread.

Without modification to the event mpm, it would potentially cause some
issues as the event thread isn't always waking up that often, but I
think we can figure out a way to do this without too much pain (either
a pipe trigger to wake up when in 'slow mode', or just lower the
default timeout on the pollset form 500ms to like 5ms).

Thoughts?

Thanks,

Paul

Reply via email to