Programming Programming Languages

Ален Холаб. Приручаем потоки Java by Allen Holub

By Allen Holub

Studying tips to write multithreaded functions is the most important to taking complete benefit of the Java platform. In Taming Java Threads, famous columnist and Java professional Allen Holub presents Java programmers with the data they should write genuine multithreaded courses - courses with actual code. Holub offers an in-depth clarification of ways threads paintings in addition to information regarding tips on how to resolve universal difficulties reminiscent of deadlocks and race stipulations. He not just explains universal difficulties, but additionally presents the unusual strategies that mark the variation among production-level code and toy demos.Topics lined during this publication comprise the structure of threads; the mutex and lock administration; situation variables and counting semaphores; timers, alarms, and swing thread security; observers and multicasters; singletons, serious classes, and reader/writer locks; threads in an object-oriented international; and object-oriented threading architectures.While it's necessary to construct aid for threading right into a Java application from the very starting, such a lot books at the matters of Java-UI building and Java networking slightly contact on threading subject matters. in addition to being a uncomplicated Java reference, this ebook is a must-read for any Java developer.

Show description

Read Online or Download Ален Холаб. Приручаем потоки Java PDF

Similar programming: programming languages books

The Visibooks Guide to PERL Basics

The Visibooks consultant to PERL fundamentals is helping newcomers the way to create interactive sites utilizing the PERL programming language. It presents an organization beginning within the basics of desktop programming.

Build Your Own Database Driven Web Site Using PHP MySQL, 4th Edition

Again in 2001, while I wrote the 1st variation of this ebook, readers have been astonished to find that you may create a domain packed with websites with no need to write down a separate HTML dossier for every web page. Hypertext Preprocessor stood out from the group of programming languages, quite often since it was once effortless sufficient for nearly somebody to benefit and loose to obtain and set up.

C++ for Everyone, 2nd Edition

Thorough and up to date insurance on all of the crucial C++ conceptsAimed at giving you a pretty good starting place in programming with C++, this new version accommodates programming workouts with priceless self-check questions that make stronger the innovations mentioned during the e-book. You’ll enjoy the how-to sections that exhibit you ways recommendations are utilized and complex fabrics are featured at the accompanying website while you’re able to take your programming talents to the following point.

Java in Datenbanksystemen : JDBC, SQLJ, Java-DB-Systeme und -Objekte ; [Beispiel lauffähig für Oracle, DB2 und MySQL]

Große Software-Projekte, die heute mit Java umgesetzt werden, nutzen nahezu immer Datenbanken im Hintergrund. Geschäfsanwendungen ohne Datenbank administration Systeme (DBMS) sind nicht zu realisieren. Daher ist es für Java-Entwickler wichtig, sowohl die Grundlagen als auch die Anbindungstechniken zu beherrschen.

Extra info for Ален Холаб. Приручаем потоки Java

Sample text

I'll show you how to cure a race condition with the Simple_notifying_queue class, which demonstrates a blocking queue used by one thread to notify another when some event occurs. ) The basic notion is that a thread that tries to dequeue from an empty queue will block until some other thread puts something in the queue. The queue is implemented as a ring buffer, in which the first 30 element effectively follows the last element. 1). The queue is empty when the head and tail indexes match, so one slot in the queue is always wasted.

Of course, any Object will do as the argument to a synchronized statement; even an array will work. You can't use a primitive (like an int or boolean) for this purpose, however. Wilma and Betty are a contrived example, but the multiple-lock situation comes up frequently. I'll give a more detailed example in the Chapter 3. Deadlock can occur any time that multiple threads each attempt to acquire several locks, but in a different order. Get out the Magnifying Glass If all deadlock scenarios were as easy to recognize as Wilma and Betty, deadlock wouldn't be a problem.

48 Inner Classes I use inner classes heavily throughout the book. A program is simply easier to read and maintain if you define all symbols in the most restrictive scope possible. The same thinking that precludes you from moving your local variables out to class scope, should be applied to classes as well. They have no business being at package scope unless they're used by more than one class. That is, if some "helper" class is used only by one other class, the helper class should be defined as an inner class of the class that uses it.

Download PDF sample

Rated 4.62 of 5 – based on 7 votes