• 8.2.Task


    1. Task.Run()
      StackCrawlMark stackMark=StackCrawlMark.LookForMyCaller;
      return Task.InternalStartNew(null,action,null,default(CancellationToken),TaskScheduler.Default,TaskCreationOptions.DenyChildAttach,InternalTaskOptions.None,ref stackMark);

    2. Task.Factory
      private readonly static TaskFactory s_factory=new TaskFactory();
      return s_factory;

    3. TaskFactory.StartNew()
      StackCrawlMark stackMark=StackCrawlMark.LookForMyCaller;
      Task currTask=Task.InternalCurrent;
      return Task.InternalStartNew(currTask,action)

    4. TaskFactory.GetDefaultScheduler(Task currTask)
      if(m_defaultScheduler!=null)return m_defaultScheduler;
      return currTask.ExecutingTaskScheduler;
      return TaskScheduler.Default;

    Task.cs 7309行

    1. internal class Shared

    2. public enum TaskStatus

    1. created   //已创建没有列入计划执行
    2. waitingForActivation     //等待.net加入加入计划
    3. waitingToRun             //已列入计划,但是还未执行
    4. running                  //正在执行但是没有激素
    5. waitingforchildrentocomplete   //任务执行完毕,隐式等待子任务的完成
    6. runtocompletion  //任务全部顺利执行完毕
    7. canceled         //手动跑出OperationCanceledException 异常停止task
    8. faulted          //发生任何异常导致任务结束
    

    3. Task

    4. internal class SystemThreadingTasks_TaskDebugView

    5. internal class ParallerForReplicatingTask

    6. internal class ParallerForReplicaTask

    7. public enum TaskCreationOptions

    1. None
    2. PreferFairness
    3. LongRunning
    4. AttachedToParent
    5. DenyChildAttach
    6. HideScheduler
    7. RunContinuationsAsynchronously
    

    8. public enum InternalTaskOptions

    9. public enum TaskCountinuationOptions

    10. internal class StackGuard

    这就是
  • 相关阅读:
    流媒体服务器搭建
    netcore问题总结
    Linux(Debian)网卡设置
    windows服务器让WEB通过防火墙的问题
    经典算法一 --- 过桥问题
    MySQL字段属性介绍
    什么是流程控制
    终于决定了,转行。
    浅析Openflow
    JavaScript 中 this 的详解
  • 原文地址:https://www.cnblogs.com/zhangrCsharp/p/7695589.html
Copyright © 2020-2023  润新知