Forums Register Login

starting a thread

+Pie Number of slices to send: Send
Hi,
I understand from basic java material that start method of the thread
calls the run method which executes an instance of runnable. what i dont understand is
what happens after we call start()...what happens between the
time start method calling the run() method and the time run() starts executing.. what actions are performed on the runnable instance during this time? thanks in advance
+Pie Number of slices to send: Send
Welcome to JavaRanch.

The start() method of class Thread creates a new thread that starts running in parallel (i.e. at the same time) with other threads in the system. The run() method of the Runnable is the code that's being executed in the new thread.

How exactly start() creates a new thread depends on the underlying operating system. No special actions are done on the Runnable.
please buy my thing and then I'll have more money:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 530 times.
Similar Threads
thread EXAM WATCH from K&B
difference between start() and run() of a thread instance
doubt on thread
Overriding the start method of Thread Class
Thread tricky questions.
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 01:46:45.