2.7 Conclusion

 < Day Day Up > 



2.7 Conclusion

Thread-based programming in Java involves understanding how to create threads and how to control them with the synchronize keyword and wait and notify methods. This understanding is non-trivial, as the presence of threads produces nondeterministic behavior in the programs. To understand the effects of nondeterminism in a program it is necessary for the programmer to understand how a concurrent program executes and whether or not resources such as variables are actually shared. Understanding the context of each thread allows the programmer to reason about these issues. Race conditions and deadlock are two types of problems that can arise with thread programs and concurrent programs, in general, and that do not exist in procedural programming. The best way to deal with these problems is to use standard designs for components that are well understood and known to be correct. A programmer who implements solutions in any other manner needs to be very careful and should prove that the program is correct.



 < Day Day Up > 



Creating Components. Object Oriented, Concurrent, and Distributed Computing in Java
The .NET Developers Guide to Directory Services Programming
ISBN: 849314992
EAN: 2147483647
Year: 2003
Pages: 162

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net