Win a copy of Pipeline as Code this week in the Cloud/Virtualization forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Rob Spoor
  • Henry Wong
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh
  • Jj Roberts

threads

 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey guys
Can any one help me in having a link about Threads.
My real problem is I can't judge the output in the programs with threads especially when wait, sleep methods are used.

I appreciate any help in advance
uzma
 
Sheriff
Posts: 11343
Mac Safari Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I suggest...
  • The Threads lesson in The Java Tutorial, and
  • The Concurrency chapter in Bruce Eckel's Thinking in Java.
  •  
    Ranch Hand
    Posts: 134
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    the basic difference betwwen sleep and wait is that
    sleep takes the lock when it sleeps. so other thread
    which also wants to enter the same synchronized method
    on the same object couldnot enter. but wait release the
    lock . so other thread which wants to enter the same
    synchronized method on the same objectcould do so.
     
    uzma Akbar
    Ranch Hand
    Posts: 40
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    thanks weber and mahapatra

    These links are quite helpful. Knowing only the difference between sleep and wait did not really help when it comes to programs and their output. I get really confused what exactly be the out put and sometimes the output is undetermined.

    thank you guys for putting your effort again!

    uzma
     
    Whatever. Here's a tiny ad:
    SKIP - a book about connecting industrious people with elderly land owners
    https://coderanch.com/t/skip-book
    reply
      Bookmark Topic Watch Topic
    • New Topic