How to Kill a block thread

How to Kill a block thread

Post by amshai.. » Sun, 22 Oct 2000 04:00:00



Hi there,

Vmstat on one of my system continously shows three threads as been in
blocked state ( shown below), how can I get rid of them.
r  b   avm   fre  re  pi  po  fr   sr  cy  in   sy  cs us sy id wa
4  4 296559 45778   0   0   0   0    0   0 1966 20745 3216  8 28 55  9
6  3 296559 39610   0   0   0   0    0   0 1743 14671 3815  7 27 64  2
8  3 296559 34331   0   0   0   0    0   0 1712 14902 3402  7 24 65  4
7  4 296559 64684   0   0   0   0    0   0 1769 15863 3773  7 25 64  4
4  3 296559 61623   0   0   0   0    0   0 1746 11881 3497  4 16 76  3
0  3 296559 96938   0   0   0   0    0   0 1649 8638 3119  2  4 94  0
0  3 296596 96917   0   0   0   0    0   0 1621 7364 2722  2  2 96  0
0  3 296559 96917   0   0   0   0    0   0 1610 7928 2798  1  2 96  0
1  3 296559 96931   0   0   0   0    0   0 1621 9159 2877  1  2 97  0
0  3 296560 96928   0   0   0   0    0   0 1632 7671 3012  1  2 96  0

Any ideas/advice is very welcome.

Arshad.

Sent via Deja.com http://www.deja.com/
Before you buy.

 
 
 

1. Reading /dev/midi00 on linux from Java blocks until I kill the thread

Hi,

I'm trying to debug a problem reading from /dev/midi00 on Linux.

I'm establishing the stream as follows:

File file = new java.io.File("/dev/midi00");
RandomAccessFile raf = new java.io.RandomAccessFile(file , "rw");
inStream = new java.io.FileInputStream(pipe.getFD());            

and then spawning a thread that reads from the device and feeds
a buffer:

try
{
  if (inStream==null)
    break;
  while (true)
  {
    i=(byte)inStream.read ();
    // stick it in the buffer
  }
catch (Exception e)
{
  // handle it

When I generate large chunks of Midi data, the line "i=(byte)inStream.read();"
seems to block, and stays blocked forever.  If I kill the thread and start
a new one, then it resumes working (until it blocks again).

I'm using java 1.3.1, running Slackware 8, with ALSA 0.9-something.  I can
get more specific, but the fact that my Java thread is what's blocking, and
that all my other Midi apps work fine, and that killing the thread and starting
another fixes the problem all make me think it's a Java problem.

I would be thankful if anyone can set me down the right path to even
debugging something of this nature.  I can get java to give me a thread
dump, and see which threads are blocking, and where, but beyond that, how
do you go about debugging such a problem?

Thanks,

Zellyn Hunter

2. rng driver update

3. How i sleep a thread, and doesn't block another thread?

4. Sys V message queue buffer pool

5. Question: IO on one thread blocks other threads wanting to do IO?

6. Reverse engineering to write a driver

7. main thread unexpected death after killing spawned threads

8. pppd connection

9. KILL KILL KILL

10. Threads, threads, threads

11. Threads in linux versus threads in NT and threads in Solaris.

12. Kill COREL; Kill COREL; Kill COREL; ...

13. A method to kill process that cannot be killed even with `kill -9'.