cmbhatt
Originally posted by Chandra Bhatt:
The source of this code is Khalid Mughal : Chapter 9, Question 9:...
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
cmbhatt
Thanks & Regards, T.Srinivasan
SCWCD 1.4(89%), SCJP 5.0(75%)
Thanks & Regards, T.Srinivasan
SCWCD 1.4(89%), SCJP 5.0(75%)
Thanks & Regards, T.Srinivasan
SCWCD 1.4(89%), SCJP 5.0(75%)
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
Originally posted by Srinivasan thoyyeti:
...If the Parent thread(main) complete its job, can the child threads in it still run? ...
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
Thanks & Regards, T.Srinivasan
SCWCD 1.4(89%), SCJP 5.0(75%)
Do you know UML, The above diagram remembers me the Sequence diagram. Well done. You present things very well.
main process
1)after 23
main started t2(20,main) and again came to picture by main.join()
2)after 13
main started t2(10,t2(20.main)) and again came to picture by t2(20,main).join() [ indirect nod from t2(20,main) "Hey main() complete your job"]
Thanks & Regards, T.Srinivasan
SCWCD 1.4(89%), SCJP 5.0(75%)
Thanks & Regards, T.Srinivasan
SCWCD 1.4(89%), SCJP 5.0(75%)
Thanks & Regards, T.Srinivasan
SCWCD 1.4(89%), SCJP 5.0(75%)
Originally posted by Srinivasan thoyyeti:
Hi Marc Weber,
Where are you...???
Please answer my last doubt posted above...
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
cmbhatt
Originally posted by Chandra Bhatt:
... I see, you have been waiting for "Marc Weber"...
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
Thanks & Regards, T.Srinivasan
SCWCD 1.4(89%), SCJP 5.0(75%)
Thanks & Regards, T.Srinivasan
SCWCD 1.4(89%), SCJP 5.0(75%)
cmbhatt
With threads, the CPU will pop around and give each thread some of its time. Each thread has the consciousness of constantly having the CPU to itself, but the CPU�s time is actually sliced between all the threads.
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
Originally posted by megha joshi:
...For the anonymous classes the constructor doesnt run when it encounters line
Thread t = new Thread{...};
Its runs only when the instance variable t is used first time.
For non anonymouns classes, the construtor runs as soon as it encounters the line
MyThread t = new MyThread();
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
I understand Mac loves all threads with same priority and time slices.
But Windows XP preference is given to Parent thread, though child eagerly waiting for run().
Thanks & Regards, T.Srinivasan
SCWCD 1.4(89%), SCJP 5.0(75%)
...thread priorities are highly system dependent...
For example, Windows NT/XP has seven priority levels. Some of the Java priorities will map to the same operating system level. In the Sun JVM for Linux, thread priorities are ignored altogether -- all threads have the same priority.
Thus, it is best to treat thread priorities only as hints to the scheduler. You should never structure your programs so that their correct functioning depends on priority levels.
CAUTION: ...If you have several thread with a high priority that rarely block, the lower-priority thread may never execute.
...Windows 2000 has 7 priority levels that are not fixed, so the mapping is indeterminate (although Sun's Solaris has 2^31 levels). The only portable approach is to stick to MAX_PRIORITY, NORM_PRIORITY, and MIN_PRIORITY when you�re adjusting priority levels.
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
Thanks & Regards, T.Srinivasan
SCWCD 1.4(89%), SCJP 5.0(75%)
You save more money with a clothesline than dozens of light bulb purchases. Tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|