zoukankan      html  css  js  c++  java
  • Day 26 multiprocess

    Day 26

    Process State

    Created

    Running

    Terminated

    Blocked

    Waiting/Ready

    Zombie process

    A zombie process is a process whose execution is completed but it still has an entry in the process table. Zombie processes usually occur for child processes, as the parent process still needs to read its child's exit status

    How do you kill a zombie process?

    A zombie is already dead, so you cannot kill it. To clean up a zombie, it must be waited on by its parent, so killing the parent should work to eliminate the zombie. (After the parent dies, the zombie will be inherited by pid 1, which will wait on it and clear its entry in the process table.

    Is it bad to have zombie processes on your system?

    The presence of zombie processes also indicates an operating system bug if their parent processes are not running anymore. This is not a serious problem if there are a few zombie processes but under heavier loads, this can create issues for the system.

    Orphan process

    An orphan process is a computer process whose parent process has finished or terminated, though it remains running itself.

    Daemon process

    A daemon process is a background process that is not under the direct control of the user. This process is usually started when the system is bootstrapped and it terminated with the system shut down. Usually the parent process of the daemon process is the init process

    Mutex in Python

    A mutex is an object enabling threads of execution to protect critical sections of code from reentrancy or to temporarily protect critical data sets from being updated by other threads. The term “mutex” derives from the notion of mutual exclusion

    How to use Mutex in python

    mutex = threading.Lock()

    mutex.acquire()
    print("mutex is now locked")
    OUTPUT
    # mutex is now locked

    mutex.release()
    print("mutex is now unlocked")
    OUTPUT
    # mutex is now unlocked

     

  • 相关阅读:
    INT 21H 指令说明及使用方法 (转载)
    数织等逻辑游戏网站推荐
    常见文件格式(转载)
    我有一个通信梦 我收集的通信基础的资源
    MATLAB信号处理常用函数(转载)
    来自我的Moments-实用学习资源或网站
    三角形中的等量关系 一些等式
    【公式编辑测试】三角形中线垂线角平分线长度公式
    【备忘录】麦克斯韦速率分布
    【备忘录】转动惯量张量(转载和再补充一些东西)
  • 原文地址:https://www.cnblogs.com/fengshili666/p/14302666.html
Copyright © 2011-2022 走看看