gudii9
asked on
thread ID setting
Hi,
I am working on below example
http://www.avajava.com/tutorials/lessons/how-do-i-identify-a-thread.html
I have not seen author setting thread ID anywhere. Where it is getting set.
i see output as below
RunnableJob is being run by thread1 (9)
RunnableJob is being run by Thread-1 (11)
Main thread: main(1)
RunnableJob is being run by thread2 (10)
which line is printing below output
RunnableJob is being run by Thread-1 (11)
please advise
Any links resources ideas highly appreciated. Thanks in advance
I am working on below example
http://www.avajava.com/tutorials/lessons/how-do-i-identify-a-thread.html
I have not seen author setting thread ID anywhere. Where it is getting set.
i see output as below
RunnableJob is being run by thread1 (9)
RunnableJob is being run by Thread-1 (11)
Main thread: main(1)
RunnableJob is being run by thread2 (10)
which line is printing below output
RunnableJob is being run by Thread-1 (11)
please advise
Any links resources ideas highly appreciated. Thanks in advance
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
which is Default thread?
When I said "default thread name," I meant "the name that is assigned to threads, by default." There is no such thing as a "default thread."
ASKER
Default thread is below thread in the code right?
Please advise
Thread thread3 = new Thread(runnableJob);
thread3.start();
Please advise
There is no such thing as a "default thread."
In that code, that thread is being assigned a default name, because you didn't specify one. That's what dpearson and I were talking about on Friday.
In that code, that thread is being assigned a default name, because you didn't specify one. That's what dpearson and I were talking about on Friday.
ASKER
which is Default thread?
I see main thread and thread1 and thread2 in the code. Where from default thread is coming in this example.
How to check which specific constructor it is setting from
Please advise