What does Linux PS State sl+ mean __linux

Source: Internet
Author: User

Here's a piece of Java code,

public class Z {
public static void Main (string[] args)
{
New Z ();
}
Private Z ()
{
Z A1=this;
Z A2=this;
Synchronized (A1)

{

try {
A2.wait ();
System.out.println ("Done Waiting");
}
catch (Interruptedexception e)
{
System.out.println ("Interruptedexception");
}
catch (Exception e)
{
System.out.println ("Exception");
}
Finally
{
System.out.println ("finally");
}
}
System.out.println ("All done");
}

}


Run after compiling

Java Z

Without any output, the program will not end.


PS looked at the state, found that the state is sl+,

In Linux, the status is as follows:

D non-disruptive uninterruptible sleep (usually IO)
R is running, or the process in the queue
S is in a dormant state
T stop or be traced
Z Zombie Process
W enters memory Exchange (invalid starting from kernel 2.6)
X dead Process

< high-priority
N Low Priority
L Some pages are locked into memory
s contains child processes
+ Group of processes in the background
L multi-threading, cloning threads


Based on the above information, it is known that it is in hibernation, multithreading, and is a background process.

We know that in Java,

Wait (): Leave the thread in the waiting state. The thread will then release the lock. Coexist into the thread pool.
Notify (): Usually wakes up the first one in the thread pool.
Notifyall (): Wakes all waiting threads in the thread pool.

So while waiting, this thread sleeps and waits for other threads to notify, so it's dormant.

Reprint please indicate the source:

Original: http://blog.csdn.net/hongchangfirst/article/details/8650628

Author: Hongchangfirst



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.