• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Paul Hyde thread relevance

 
Ranch Hand
Posts: 504
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
Who's read Paul Hyde's threads, can you tell me how relevant it is today for the exam? The book was released in 1999, and at that time Thread's methods like stop(), suspend(), and resume() could've been OK. I know there's tons of good stuff in there, just trying to figure out if this is a good investment.
 
Ranch Hand
Posts: 1392
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Vad,
I have read a little of Paul Hyde�s Java Thread Programming and a little of Scott Oak�s Java Threads. Both books offer a lot of helpful insights into thread programming.
I like Hyde�s book. The writing is clear. There are many examples that are sort of like experiments to demonstrate what is happening. There are nice graphs and tables to show what is happening in time.
But I stopped reading it because I was did not completely trust it. I have interlinear notes and question marks here and there.
Hyde says a thread that invokes wait() �sleeps�. Doug Lea says the thread is added to the wait set of the object. Doug Lea says the thread blocks.
Hyde says the thread releases the object-level lock. �object-level�?
When I tried his examples on �volatile�, they did not work for me, although I don�t remember the details.
On yield(), Hyde says a thread can voluntarily give up its turn early. The scheduler will swap it off the processor and allow another thread to run. Doug Lea say yield() is a purely heuristic hint advising the JVM that if there are other runnable threads, the scheduler should run one or more of these threads rather than the current thread. The JVM may interpret this hint any way it likes.
Hyde says �When the lock is released, all the threads waiting for it compete for exclusive access. Only one will be successful, and the other threads will go back into the blocked state waiting for the lock to be released again.� (page 132) �go back�? Or is only one thread unblocked?
I decided it was safer for me to learn from Gosling - The Java Programming Language and Lea - Concurrent Programming in Java.
To be fair to Paul Hyde, let's say this is my first impression. I need to read the whole book.
 
Vad Fogel
Ranch Hand
Posts: 504
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot Marlene for this detailed analysis! It looks like you'd prefer using Lea's book rather than Hyde's?
Seriously, I'm a bit upset at not having an up-to-date readable manual on threads with working examples (do I wish too much?). JLS doesn't provide a great variety of code samples on threads trying to keep it concise.
 
Marlene Miller
Ranch Hand
Posts: 1392
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Vad.
For the exam we need completely correct, trustworthy statements about threads and we also need an intuitive understanding of threads.
For completely correct and trustworthy statements about threads, I recommend The Java Programming Language Chapter 10.
I guess I like Doug Lea�s book even more, because it is a little more precise, which makes it easier for me to understand. As far as I know, Lea is an authority on Java threads. However, his book is far more advanced than we need. I only read the basics.
My guess is you want to develop your intuitive understanding of threads to help you analyze the exam questions.
For that purpose, Paul Hyde�s book is the best choice of the books I have seen. Read with caution. Verify what he says with TJPL. Learn from the examples and the general concepts. His examples are an important part of his teaching. In my opinion his examples are more important for demonstrating the concepts than to teach how to program. Code, compile and run them yourself.
I find the Whizlabs mock exams to be very helpful. There is quite a variety of imaginative thread questions. I am studying them very carefully. In my opinion these exams have errors in the questions, answers and explanations. So I have to be careful. But I still find them very helpful.
Of course Dan Chisholm's topic exams on threads are helpful and trustworthy.
[ October 04, 2003: Message edited by: Marlene Miller ]
 
Vad Fogel
Ranch Hand
Posts: 504
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks again Marlene. If I get you right, Ken Arnold and James Gosling are the authors of "The Java Programming Language", and that's the 3rd edition?
 
Marlene Miller
Ranch Hand
Posts: 1392
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, The Java Programming Language Third Edition, Arnold, Gosling, Holmes
[ October 05, 2003: Message edited by: Marlene Miller ]
 
Marlene Miller
Ranch Hand
Posts: 1392
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Vad.
Some people are focused exclusively on obtaining the SCJP certificate, while other people have a little more time or reason to try to understand the language along the way. These next suggestions are for the second group.
My introduction to threads was Cay Horstmann�s Core Java Volume II, Chapter 1. 113 pages, 13 complete working, running examples. His style of writing is conversational and easy to understand. He is a university professor at SJSU. This chapter will help to give you an intuitive understanding of threads.
Every now and then people ask why wait and notify are defined in Object rather than Thread, or they ask why wait and notify must be invoked on an object and by a thread that the lock of the object. I have come to understand, the answer is obvious if you know what a monitor is.
To learn what a monitor is and for some insight into how the JVM implementation of threads relies on the underlying OS, I occasionally read from Tanenbaum�s Modern Operating Systems, Chapter 2 Processes and Threads.
 
Vad Fogel
Ranch Hand
Posts: 504
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Marlene, obviously, I belong to the second group based on your definition: I'm not comfortable with the subject unless I know it. With the threads though, one can never claim having sufficient knowledge. Thanks for the links!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic