zoukankan      html  css  js  c++  java
  • nullnullWorking principles about multithreading, deadlock

    最近使用开发的过程中出现了一个小问题,顺便记录一下原因和方法--nullnull

        /*

        Author: Jiangong SUN

        */

        

        What is multithreading ?

        Every application runs with at least one thread.  So what is a thread?  A thread is nothing more than a process.  

        I've heard a thread is an execution path of applications.

        

        Multithreading is managed internally by a thread scheduler, afunction the CLR typically delegates to the operating system.A thread scheduler ensures all active threads are allocated appropriate execution time, and that threads that are waiting or blocked (for instance, on an exclusive lock or on user input)  do not consume CPU time.

        每日一道理
    冰心说道:“爱在左,同情在右,走在生命的两旁,随时撒种,随时开花,将这一径长途,点缀得香花弥漫,使穿枝拂叶的行人,踏着荆棘,不觉得痛苦,有泪可落,却不是悲凉。”

        

        Like multiple process in Windows system, multiple threads exist in process.

        

        How to prevent deadlock ?

        Lock leveling

        LeveledLock lockA = new LeveledLock (10); 

        LeveledLock lockB = new LeveledLock (5);

        

        

        

        

        reference:

        http://www.albahari.com/threading/

        

    文章结束给大家分享下程序员的一些笑话语录: 女人篇
      有的女人就是Windows虽然很优秀,但是安全隐患太大。
      有的女人就是MFC她条件很好,然而不是谁都能玩的起。
      有的女人就是C#长的很漂亮,但是家务活不行。
      有的女人就是C++,她会默默的为你做很多的事情。
      有的女人就是汇编虽然很麻烦,但是有的时候还得求它。
      有的女人就是SQL,她会为你的发展带来莫大的帮助。

  • 相关阅读:
    (unix domain socket)使用udp发送>=128K的消息会报ENOBUFS的错误
    HTTP KeepAlive模式
    Windows 7 中的 God Mode
    我的开发环境配置经验
    C#格式化数值结果表(格式化字符串)
    我可怜的笔记本电脑
    JetBrains ReSharper 5.x 注册机
    异常处理准则
    调用 Windows 7 中英文混合朗读
    oracle笔记(2010130)
  • 原文地址:https://www.cnblogs.com/xinyuyuanm/p/3085899.html
Copyright © 2011-2022 走看看