Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Difference between ligt weight and heavy weight?

Answer Posted / modi[achir communication]

[Short answer: threads are lightweight, programs (aka
processes or tasks) are heavyweight. -Alex]

Lightweight and heavyweight processes refer the mechanics of
a multi-processing system.

In a lightweight process, threads are used to divvy up the
workload. Here you would see one process executing in the OS
(for this application or service.) This process would posess
1 or more threads. Each of the threads in this process
shares the same address space. Because threads share their
address space, communication between the threads is simple
and efficient. Each thread could be compared to a process in
a heavyweight scenario.

In a heavyweight process, new processes are created to
perform the work in parallel. Here (for the same application
or service), you would see multiple processes running. Each
heavyweight process contains its own address space.
Communication between these processes would involve
additional communications mechanisms such as sockets or pipes.

The benefits of a lightweight process come from the
conservation of resources. Since threads use the same code
section, data section and OS resources, less overall
resources are used. The drawback is now you have to ensure
your system is thread-safe. You have to make sure the
threads don't step on each other. Fortunately, Java provides
the necessary tools to allow you to do this.

Is This Answer Correct ?    14 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is java swing package?

963


How to render an html page using only swing.

1008


How is parsing html used in swing?

1042


What is difference between swing and awt?

983


What is the process of setting the layout manager?

1055


Write a program to include the internal frame in swing.

1011


What is swing and awt in java?

1035


Is swing thread-safe?

1009


How to reload a jframe in java swing?

1037


What is the purpose of serialization in swings?

1008


What is pane in swing?

953


What is jpanel in java swing with example?

995


What is difference between jframe and swing?

967


What is swing and its features in java?

1034


What is import javax swing jframe?

1020