apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bojan Smojver <bo...@rexursive.com>
Subject Re: svn commit: r683191 - /apr/apr-util/trunk/misc/apr_reslist.c
Date Thu, 07 Aug 2008 02:32:00 GMT
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


Mime
View raw message