• Post Reply Bookmark Topic Watch Topic
  • New Topic

Stupid Question

 
Anthony Smith
Ranch Hand
Posts: 285
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got 2 threads and the second one will not execute (start). They are called one after another. Any reason why not?
 
Ellen Zhao
Ranch Hand
Posts: 581
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check if you have run into any of the 4 conditions below:
1.You�ve put the thread to sleep by calling sleep(milliseconds), in which case it will not be run for the specified time.
2.You�ve suspended the execution of the thread with wait( ). It will not become runnable again until the thread gets the notify( ) or notifyAll( ) message.
3.The thread is waiting for some I/O to complete.
4.The thread is trying to call a synchronized method on another object, and that object�s lock is not available.

Ellen
 
Jon Strayer
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or maybe you called run() instead of start().
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anthony, it would probably help a lot if you could post some of your code...
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!