Basic HTML version of Foils prepared Sept 21 1998

Foil 13 Threads and Synchronization II

From Java Tutorial 98- 4: Multi-Treading, Useful Java Classes, I/O and Networking NAVO Tutorial -- Sept 23 1998. by Geoffrey C. Fox, Nancy McCracken


1 void notify()
2 void notifyAll()
  • These methods must be called from a synchronized method.
  • These methods notify a waiting thread or threads.
3 notify() notifies the thread associated with the given synchronization object that has been waiting the longest time
4 notifyAll() notifies all threads associated with the given object and is therefore safer than notify()
5 One can mark a variable as "threadsafe" to inform the compiler that only one thread will be modifying this variable.

in Table To:


© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Sat Nov 28 1998