• 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
  • Liutauras Vilda
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Peter Rooke
  • Himai Minh
Bartenders:
  • Piet Souris
  • Mikalai Zaikin

Dan's: Thread Q 39

 
Ranch Hand
Posts: 279
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dan, your Thread Questions are very good: I don't understand though the answer of Q 39: I understand the it prints ABC, but why would the run method wait for ever and print nothing? You didn't explain that, and I am not sure it's a correct answer...
So, Dan - or anyone that can - explain it to me...
 
Ranch Hand
Posts: 1865
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Alfred,
Thank you for asking that question. I now realize that the "waiting forever" answer option wasn't particularly instructive in that situation.
When working with threads there is always that possibility that the thread scheduler won't allow a particular thread to run. However, I agree that the possibility is not high. To avoid that issue I changed the question a little and eliminated the "wait forever" answer option.
 
Yeast devil! Back to the oven that baked you! And take this tiny ad too:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic