On Wed, 2008-08-06 at 12:27 +0200, Mladen Turk wrote:
> The major problem with invalidate is that blocking
> destructors (socket shutdown for example)
> are serialized, meaning that closing 100 sockets
> is done one at a time instead by owning threads in
> parallel.
Why don't you instead shut the socket down from your code just before
calling apr_reslist_invalidate() and set a flag inside the resource
itself that things have already been cleaned. Then the destructor
(although serialised) will run fast. Like this:
----------------
thread:
socket-shutdown
already-cleaned-up=true
apr_reslist_invalidate
destructor:
if already-cleaned-up
return
socket-shutdown
----------------
--
Bojan