java - How to wait several objects -


I have a thread that many objects have to wait from different threads.

  @Override Public Zero run () {while (true) {for (background task tasks: actions) {synchronize (work) {if (task.isReady ()) {task.doTask (); }}}}}   

But this is the stupid use of CPU time how many objects wait for

Please use notifyaAll () to notify () because the notification awakens a thread, as all inform () all Waiting threads arise.

Comments

Popular posts from this blog

qt - switch/case statement in C++ with a QString type -

python - sqlite3.OperationalError: near "REFERENCES": syntax error - foreign key creating -

Python's equivalent for Ruby's define_method? -