views:

389

answers:

5

Threads are light weight processes, what does it mean?

A: 

It means they lack some of the features, and therefore some of the overhead, of being full-fledged system processes.

chaos
+2  A: 

Hi Johanna,

According to Wikipedia's definition some resources like memory can be shared between threads.

Hope this will help you.

SourceRebels
Thanks a lot for your answer!
Johanna
A: 

They are not processes from an OS standpoint as they do not have their own memory space and therefore run within the memory space of the application that creates them.

For a somewhat bad analogy, think of a computer as a neighborhood, each individual house as a process where each house comes with the overhead of plumbing, phone, electric, mailbox, etc. Threads would be more like rooms within the house - little overhead except for the space the consume within the house (i.e. process), with the possibility of each being used for a specific task or activity.

RC
A: 

In early version of POSIX (and Solaris - as motherland platform of Java) it was a way to start thread.

Dewfy
A: 

It means that creating and maintaining a process is a relatively large amount of work in many operating systems, primarily because each process has its own address space. Threads within a process share their address space, and therefore creating lots of short-lived threads is much less resource-intensive than creating an equal number of processes would be.

For example, early CGI-based web applications would have the web server create a separate process to handle each request. But such applications couldn't handle much load, a few dozen requests per second would overwhelm them (this being in the late 90s, on much slower hardware as well). Web applications that use threads to handle individual requests, such as those based on Java Servlets, are much more scalable - Even back then, Servlet apps running on comparatively slow JVMs were easily outperforming traditional CGI apps written in C, because the process creation overhead outweighted the speed advantages of C.

Read more about this on Wikipedia.

Michael Borgwardt