zoukankan      html  css  js  c++  java
  • ExeCuteManager

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading;
    using WindowsFormsApplication3.Jobs;
    using WindowsFormsApplication3.DataStorge;
    using WindowsFormsApplication3.Enums;
    
    namespace WindowsFormsApplication3.Jobs.Operation_System
    {
        public class ExeCuteManager:BaseJob
        {
    
            public ExeCuteManager(CheckoutContext checkoutContext, CheckoutStep checkoutStep) : base(checkoutContext, checkoutStep) { }
    
    
            public override void Execute(object _stateInfo)
            {
                int IntNumber = (int)_stateInfo;
                //获得当前线程的哈希码(标识线程在线程池中的唯一)
                int ThisThreadNumber = Thread.CurrentThread.GetHashCode();
                //指示当前线程是否属于托管线程池
                bool isThreadPool = Thread.CurrentThread.IsThreadPoolThread;
                string strTip = string.Format("请求 {0} 开始,线程哈希码为{1},是否为线程池线程:{2},...", IntNumber, ThisThreadNumber, isThreadPool.ToString());
                ReportStateChange(strTip, IntNumber, false);
    
                Thread.Sleep(4000);
                strTip = string.Format("请求 {0} 执行结束!", IntNumber);
                ReportStateChange(strTip, IntNumber, true);
    
            }
        }
        
    }
  • 相关阅读:
    logging模块
    configparser模块
    hashlib模块
    shutil模块
    json与pickle模块
    random模块
    OS模块
    如何不使用共享内存实现windows与虚拟机中进行文件的传输
    结构体的定义方式(仅定义)
    数据结构练习之寻找顺序表中的主要元素
  • 原文地址:https://www.cnblogs.com/rosizel/p/3857313.html
Copyright © 2011-2022 走看看