Problem with Mutex: Threads don't wakeup

L

Laurent

Hi all!

I am writting an application that runs about 100-200 threads that share
a few specialized buffers. I am using the Mutex class to share the
buffers between the different threads.

I am experiencing some weird problems where apparently some threads are
waiting for the mutex and don't get it even tho it is free. If I add a
little 'monitoring thread' that wakes them up, it seems to work fine.

Anyone has some hints on what could go wrong?

I'll be glad to give more information if needed...

Thanks!
Laurent
 
B

Bill Kelly

From: "Laurent said:
I am writting an application that runs about 100-200 threads that share
a few specialized buffers. I am using the Mutex class to share the
buffers between the different threads.

I am experiencing some weird problems where apparently some threads are
waiting for the mutex and don't get it even tho it is free. If I add a
little 'monitoring thread' that wakes them up, it seems to work fine.

Anyone has some hints on what could go wrong?

I'll be glad to give more information if needed...

Hi,

Are you using timeout{} or Thread#raise anywhere in your code? :)

Also, you might want to try installing the fastthread gem, which is a C
implementation of thread.rb, just to see if the behavior you're seeing
changes at all. (Change require 'thread' to require 'fastthread'...)
http://rubyforge.org/frs/?group_id=1306&release_id=10507

Anyway, just some ideas... Otherwise, you may want to see if you
can reproduce the problem in a small program, and post it here?


Regards,

Bill
 
R

Robert Klemme

Hi all!

I am writting an application that runs about 100-200 threads that share
a few specialized buffers. I am using the Mutex class to share the
buffers between the different threads.

I am experiencing some weird problems where apparently some threads are
waiting for the mutex and don't get it even tho it is free. If I add a
little 'monitoring thread' that wakes them up, it seems to work fine.

Anyone has some hints on what could go wrong?

I'll be glad to give more information if needed...

Yes, pleast post sme code - ideally a small sample that reproduces the
behavior you are seeing.

Kind regards

robert
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top