示例#1
0
        internal MyTaskProcessContext(int step, TaskRunnerBase.RunnerContext context)
        {
            if (step < 1)
            {
                throw new ArgumentOutOfRangeException();
            }
            if (step > PracticeSettings.TASK_TOTAL_STEPS)
            {
                throw new ArgumentOutOfRangeException();
            }

            this.CurrentStep = step;
            this._context    = context;

            //Thread.Sleep(PracticeSettings.TASK_STEP_CONTEXT_INIT_DURATION[this.CurrentStep]);
            //Interlocked.Add(ref this._context._allocated_memory_size, PracticeSettings.TASK_STEP_CONTEXT_BUFFER[this.CurrentStep]);
            this._buffer_handler = this._context.AllocateBuffer(PracticeSettings.TASK_STEP_CONTEXT_BUFFER[this.CurrentStep]);
        }
示例#2
0
 internal MyTask(TaskRunnerBase.RunnerContext context)
 {
     this._context = context;
     this.ID       = this._context.GetSeed();
 }