|
-
January 7th, 2010, 08:30 AM
#1
advantage of using thread
The key in using threads to simplify your code is to try to keep your functions and methods on one train of thought. Rather than turn your code into an arthritic mess trying to interleave multiple simple simultaneous tasks, code each task separately. Code each line block with one mind. Let the OS thread scheduler do the interleaving.
http://marcja.wordpress.com/2007/04/...ultithreading/
What do you understand from this?
-
January 7th, 2010, 08:32 AM
#2
Re: advantage of using thread
 Originally Posted by Abalfazl
The key in using threads to simplify your code is to try to keep your functions and methods on one train of thought. Rather than turn your code into an arthritic mess trying to interleave multiple simple simultaneous tasks, code each task separately. Code each line block with one mind. Let the OS thread scheduler do the interleaving.
http://marcja.wordpress.com/2007/04/...ultithreading/
What do you understand from this?
-
January 7th, 2010, 09:14 AM
#3
Re: advantage of using thread
Are you asking yourself what you understand from that, or trying to bump your thread? 
I understand it just fine, what do you not understand about it? Asking a question like "what do you understand from this" isn't a really good question to ask.
-
January 7th, 2010, 09:47 AM
#4
Re: advantage of using thread
 Originally Posted by ProgramThis
Are you asking yourself what you understand from that, or trying to bump your thread?
I understand it just fine, what do you not understand about it? Asking a question like "what do you understand from this" isn't a really good question to ask.
Future self arguing past self.
------
If you are satisfied with the responses, add to the user's rep!
-
January 7th, 2010, 01:39 PM
#5
Re: advantage of using thread
Code each line block with one mind. Let the OS thread scheduler do the interleaving.
1-Is it the Os or is it the JVM choose which thread to run?
2- What is the relationship between JVM and OS thread scheduler ?
-
January 7th, 2010, 05:44 PM
#6
Re: advantage of using thread
Have you tried Googling for the answers to these questions? Have you tried searching this forum for the answers (hint) ?
They sound very much like homework assignment questions that you're expected to discover for yourself.
I might be inclined to help if you tell me what you've discovered for yourself and explain why it isn't enough for you, or what it is you don't understand.
The outcome of any serious research can only be to make two questions grow where only one grew before...
T. Veblen
Please use [CODE]...your code here...[/CODE] tags when posting code. If you get an error, please post the full error message and stack trace, if present.
-
January 8th, 2010, 07:00 AM
#7
Re: advantage of using thread
http://www.cs.umd.edu/class/fall2007...Threads-6p.pdf
Page 4
Scheduler is part of OS or Java Virtual Machine (JVM)
May you explain more about mechanism of Scheduler?
-
January 8th, 2010, 05:15 PM
#8
Re: advantage of using thread
Try this.
One can think effectively only when one is willing to endure suspense and to undergo the trouble of searching...
J. Dewey
Please use [CODE]...your code here...[/CODE] tags when posting code. If you get an error, please post the full error message and stack trace, if present.
-
January 8th, 2010, 10:43 PM
#9
Re: advantage of using thread
VM to OS Thread Mapping
The way Java threads are mapped to OS threads is up to the JVM and its use of multiple processors on a machine. Different JVMs use different strategies:
Some JVMs use green threads, running all Java threads in one native OS thread (called n-to-one mapping). Sun's HotSpot JVMA website external to this site uses native threads, which may execute in parallel on a multi-CPU machine. On Solaris, Java threads are not bound permanently to the same native threads but are remapped by the scheduler (in an n-to-m mapping).
1-What is thread mapping?
2-What is native thread?What its difference with green thread?
-
January 9th, 2010, 07:21 AM
#10
Re: advantage of using thread
 Originally Posted by Abalfazl
1-What is thread mapping?
2-What is native thread?What its difference with green thread?
You really need to learn how to use search engines, and think for yourself - reread what you just quoted, and think about it.
The Internet? Is that thing still around?
Homer Simpson
Please use [CODE]...your code here...[/CODE] tags when posting code. If you get an error, please post the full error message and stack trace, if present.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|