[GUIDE][INFO]Concurrency and Threads

Was this information helpful?

  • Somewhat

    Votes: 0 0.0%
  • No

    Votes: 0 0.0%

  • Total voters
    4
  • Poll closed .
Status
Not open for further replies.
Search This thread

TRusselo

Inactive Recognized Developer
Jan 20, 2011
4,736
2,931
Edmonton
All info is COPIED almost word for word from Oricle (Java) website.

http://docs.oracle.com/javase/tutorial/essential/concurrency/sleep.html

from above:
Thread.sleep causes the current thread to suspend execution for a specified period. This is an efficient means of making processor time available to the other threads of an application or other applications that might be running on a computer system. The sleep method can also be used for pacing, as shown in the example that follows, and waiting for another thread with duties that are understood to have time requirements, as with the example below.

Two overloaded versions of sleep are provided: one that specifies the sleep time to the millisecond and one that specifies the sleep time to the nanosecond. However, these sleep times are not guaranteed to be precise, because they are limited by the facilities provided by the underlying OS. Also, the sleep period can be terminated by interrupts. In any case, you cannot assume that invoking sleep will suspend the thread for precisely the time period specified.

from Java site:
Thread.sleep causes the current thread to suspend execution for a specified period. This is an efficient means of making processor time available to the other threads of an application or other applications that might be running on a computer system. The sleep method can also be used for pacing, as shown in the example that follows, and waiting for another thread with duties that are understood to have time requirements, as with the SimpleThreads example in a later section.

Two overloaded versions of sleep are provided: one that specifies the sleep time to the millisecond and one that specifies the sleep time to the nanosecond. However, these sleep times are not guaranteed to be precise, because they are limited by the facilities provided by the underlying OS. Also, the sleep period can be terminated by interrupts, as we'll see in a later section. In any case, you cannot assume that invoking sleep will suspend the thread for precisely the time period specified.
 
Last edited:

uprightbass360

Senior Member
Dec 21, 2012
128
39
thank you !
but is there someone really in need of this ?

Sent from my GT-S5302 using Tapatalk 2

I am in the second quarter of an applications developer program and I will be taking a class on android programming next year. This is very interesting and at the point that I am at in my C# studies this makes some sense even though I don't know a lick of java yet. These are the most valuable stories on XDA in my opinion, it is not a walk through, it is actual factual information on a specific subject from the standpoint of an android developer. It is write ups like this that may not be wow topics, but in the end serve very useful in a forum that is dominated by overly simplistic topics. Keep it up :D
 
Status
Not open for further replies.

Top Liked Posts