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 ?
Post by:anshuman roy
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....
Post by:Stan James
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?
Post by:Smita Chopra
Thanks for helping
Post by:Ilja Preuss
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.)
Post by:Layne Lund
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?