| Author |
sleep method
|
memati bas
Ranch Hand
Joined: Jan 29, 2006
Posts: 85
|
|
Hi, Can anyone explain the exact usage purpose of the sleep method in thread ?
|
 |
Kj Reddy
Ranch Hand
Joined: Sep 20, 2003
Posts: 1697
|
|
Originally posted by memati bas: Hi, Can anyone explain the exact usage purpose of the sleep method in thread ?
Causes the current executing thread to sleep for the specified time(in milliseconds) but it do not lose ownership of any monitors.
|
 |
memati bas
Ranch Hand
Joined: Jan 29, 2006
Posts: 85
|
|
What do you imply by saying " sleep " ?? Please explain...
|
 |
Roy Ben Ami
Ranch Hand
Joined: Jan 13, 2002
Posts: 732
|
|
From Google:
Suspend process execution pending occurrence of an event; the term �block� is also used.
Basically, it means that the current thread does nothing for that time period (simply waits/blocks).
|
 |
memati bas
Ranch Hand
Joined: Jan 29, 2006
Posts: 85
|
|
Oh thanks, I think I kept the idea now...
|
 |
amod gole
Ranch Hand
Joined: Dec 07, 2005
Posts: 81
|
|
hi memati bas, using sleep method we are causing current to sleep for specific time and once that thread is sleep it leaves a cpu and another thread can start their excecution rememeber(at any instance of time cpu executes only one process)
|
 |
memati bas
Ranch Hand
Joined: Jan 29, 2006
Posts: 85
|
|
Oh, thanks amod gole. It is really explanaitory...
|
 |
 |
|
|
subject: sleep method
|
|
|