B
Bill Kelly
Hi,
I'm experiencing strange behavior in a Ruby app doing
multithreaded I/O, and I seem to have narrowed it down
to my using a timeout { } block around a condition
variable wait. E.g.
timeout(1.0) { @condition_variable.wait(@mutex) }
The whole program is currently still a bit too large
to post, but now that I'm able to reproduce the problem
pretty reliably, I think I could narrow it down to just
a few lines if need be. But first, I wanted to ask if
it's even *supposed* to be reasonable to use timeout
in this fashion.
If it's supposed to be OK to do a timeout around a
condition variable wait, then, I'll be happy to try
to narrow it down to a few lines of code that reproduce
the problem I'm seeing. (I'm seeing threads not being
awakened when signalled. Note that these are
completely different threads with different condition
variables and mutexes than the one the timeout applies to.)
If doing a timeout isn't OK around a condition variable
wait, then, I'd like to ask what alternatives are
recommended? I would very much like to have a timeout
somehow on a condition variable wait.
Thanks for your help !
Regards,
Bill
I'm experiencing strange behavior in a Ruby app doing
multithreaded I/O, and I seem to have narrowed it down
to my using a timeout { } block around a condition
variable wait. E.g.
timeout(1.0) { @condition_variable.wait(@mutex) }
The whole program is currently still a bit too large
to post, but now that I'm able to reproduce the problem
pretty reliably, I think I could narrow it down to just
a few lines if need be. But first, I wanted to ask if
it's even *supposed* to be reasonable to use timeout
in this fashion.
If it's supposed to be OK to do a timeout around a
condition variable wait, then, I'll be happy to try
to narrow it down to a few lines of code that reproduce
the problem I'm seeing. (I'm seeing threads not being
awakened when signalled. Note that these are
completely different threads with different condition
variables and mutexes than the one the timeout applies to.)
If doing a timeout isn't OK around a condition variable
wait, then, I'd like to ask what alternatives are
recommended? I would very much like to have a timeout
somehow on a condition variable wait.
Thanks for your help !
Regards,
Bill