Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
View Poll Results: Was this information helpful?
Yes 4 100.00%
Somewhat 0 0%
No 0 0%
Voters: 4. You may not vote on this poll

Thread Closed

[GUIDE][INFO]Concurrency and Threads

OP sak-venom1997

10th March 2014, 08:37 AM   |  #1  
sak-venom1997's Avatar
OP Senior Member
Flag Lucknow
Thanks Meter: 409
 
921 posts
Join Date:Joined: Feb 2013
Donate to Me
More
Mod Edit: You can find this guide in it's entirety here:

http://docs.oracle.com/javase/tutori...ncy/index.html

There is no need to copy/paste the entire thing.
Last edited by diestarbucks; 12th March 2014 at 01:27 AM. Reason: added content
The Following 10 Users Say Thank You to sak-venom1997 For This Useful Post: [ View ]
11th March 2014, 11:46 PM   |  #2  
Androguide.fr's Avatar
Recognized Contributor
Flag Lyon, France
Thanks Meter: 7,026
 
2,053 posts
Join Date:Joined: Jul 2012
Donate to Me
More
Quote:
Originally Posted by sak-venom1997

thank you !
but is there someone really in need of this ?

Sent from my GT-S5302 using Tapatalk 2

Very nice guide.
Judging by the amount of laggy apps that block the UI thread, I'd say a lot of people are in need of this
The Following 2 Users Say Thank You to Androguide.fr For This Useful Post: [ View ]
11th March 2014, 11:54 PM   |  #3  
TRusselo's Avatar
Retired Forum Moderator / Recognized Developer
Flag Edmonton
Thanks Meter: 2,797
 
4,704 posts
Join Date:Joined: Jan 2011
Donate to Me
More
All info is COPIED almost word for word from Oricle (Java) website.

http://docs.oracle.com/javase/tutori...ncy/sleep.html

from above:
Quote:

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:
Quote:

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 by TRusselo; 12th March 2014 at 12:05 AM.
12th March 2014, 12:05 AM   |  #4  
Senior Member
Thanks Meter: 38
 
128 posts
Join Date:Joined: Dec 2012
Quote:
Originally Posted by sak-venom1997

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
12th March 2014, 01:28 AM   |  #5  
diestarbucks's Avatar
Forum Moderator
Greensboro
Thanks Meter: 4,238
 
3,276 posts
Join Date:Joined: Aug 2009
More
Quote:
Originally Posted by sak-venom1997

Mod Edit: You can find this guide in it's entirety here:

http://docs.oracle.com/javase/tutori...ncy/index.html

There is no need to copy/paste the entire thing.

Thread closed.
The Following User Says Thank You to diestarbucks For This Useful Post: [ View ]
Thread Closed Subscribe to Thread

Tags
concurrency, multi treading, processes, threads
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes