Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3
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.
7th Aug 2018, 5:32 AM
PRAMOD JANA
PRAMOD JANA - avatar
0
zbns
10th Aug 2018, 3:47 PM
игорь сархандеев
игорь сархандеев - avatar
0
hese elements are named "heavy weight". Heavyweight components like "AWT" components must be drawn using native GUI on a specific platform. ... The basic difference between Swing and AWT is that Swing APIs are purely Java libraries i.e. they don't at all depend on the native libraries to draw graphical components.
11th Aug 2018, 10:01 AM
deepak sharma
deepak sharma - avatar