Forums Register Login
Process and threads
Please tell me the answer to this ques. I was asked this ques. in a recent interview.

Ques. Considering notepad/IE or any other thing as process, What will happen if you start notepad or IE 3 times? Where 3 processes are started or 3 threads are started ?

i dont know the answer as they are not related to java threads.. maybe i can suggest u a very good book..
it's oreilly's java threads....

Usually process means a "heavy weight" program context started by the operating system. If you start NotePad three times, each one is a process. You can see three applications and three processes in Task Manager.

Threads are "light weight", meaning it's a lot less work to set one up, manage it and tear it down. A single process can manage multiple threads. A new Java thread may or may not be a new thread in the operating system, depending on the version of the JVM.

Even though threads are much lighter than processes, they're not without cost. Programs that run hundreds or thousands of threaded tasks use thread pooling to reuse them rather than create and destroy them all the time.

Does that help?
Thanks for helping
IE always starts in a new process, too. If you just open a new window, though, it runs in the same process. (I think some IE versions have an option to change the latter behaviour.)
Of course, this isn't necessarily generalizable to any application. It looks like Firefox is smart enough to start a new thread in the first process rather than creating a second process when you start it again. Basically this is up to the programmer that wrote the program. Most likely Firefox does start a new process that notices one already exists. The new one then probably tells the old one that it should just open a new window. Of course, this is just my guess. I may be way off here. Who knows?

[ July 02, 2005: Message edited by: Layne Lund ]

This thread has been viewed 1068 times.

All times above are in ranch (not your local) time.
The current ranch time is
Dec 09, 2018 12:08:02.