• Waiting For Process To Complete
  • Linux: This Book Includes 4 Manuscripts. The Underground Bible to the unix operating System with Tools On Security and Kali Hacking to Understand Computer Programming, Data Science and Command Line




    Download 6,34 Mb.
    Pdf ko'rish
    bet33/203
    Sana10.01.2024
    Hajmi6,34 Mb.
    #134102
    1   ...   29   30   31   32   33   34   35   36   ...   203
    Bog'liq
    Linux This Book Includes 4 Manuscripts The Underground Bible

    Completing The Process


    To end the process, UNIX systems use the _ exit () system call. Consider
    implementing this system call in Linux. The following actions occur during
    its execution.
    1. 
    The status of the process shines through TASK _ ZOMBIE
    2. 
    The process informs the ancestors and descendants that it has
    ended (with the help of special signals)
    3. 
    The resources allocated during the fork () call are released
    4. 
    The scheduler is informed that the context can be switched
    You can use either the _ exit () system call or its exit () library function to
    complete the process in applications. This function closes all process
    threads, correctly releases all resources, and calls _ exit ( ) to actually
    complete it:
    #include
    void _exit (int status); // status specifies the return cod e
    #include
    void exit (int status); // status specifies the return code
    exit (128);
    Note that it is better not to call exit () when a process can use resources in
    conjunction with other processes (for example, it is a descendant process
    with an ancestor, and a descendant inherited resource descriptors from the
    ancestor). The reason is that in this case, trying to release the resources in
    the offspring will result in them being released from the ancestors as
    well. You must use _ exit () to complete these processes.
    Waiting For Process To Complete


    When the process is completed, its control block is not immediately
    removed from the process list and hash and remains there until another
    process (ancestor) removes it from there. If the process is actually missing
    in the system (it is finished), but only its control unit, then the process is
    called a zombie process .

    Download 6,34 Mb.
    1   ...   29   30   31   32   33   34   35   36   ...   203




    Download 6,34 Mb.
    Pdf ko'rish

    Bosh sahifa
    Aloqalar

        Bosh sahifa



    Linux: This Book Includes 4 Manuscripts. The Underground Bible to the unix operating System with Tools On Security and Kali Hacking to Understand Computer Programming, Data Science and Command Line

    Download 6,34 Mb.
    Pdf ko'rish