[Date Prev][Date Next]
Re: (ITS#6276) paused pool can deadlock if writers are waiting
Re-reading this, I'm not sure what either of us are talking about...
About reading a byte and putting it back if select() says the socket is
readable: I suppose this is only necessary if conn->c_writewaiter != 0,
and maybe only if the pool is paused. And remember that the next
select() will often also find the socket is readable, so we must read
the next byte (from the socket, not the sockbuf) and put that on the
sockbut stack, and so on.
About multiple types of pauses: The concept must be rephrased for that
to make sense. The pause mechanism is in effect a pool-wide read/write
lock which favors writers over readers. A pool thread readlocks it
while running a task. pool_pause() does unlock - writelock.
pool_resume() and pool_pausecheck() do unlock - readlock.
Now it's possible to talk about moving a few things out of this
particular lock, and if necessary protect it with another lock.