BitMaker.Miner.Gpu.GpuMiner.Start C# (CSharp) Method

Start() public method

Starts a single thread to pull and process work.
public Start ( ) : void
return void
        public void Start()
        {
            lock (syncRoot)
            {
                if (workThread != null)
                    return;

                cts = new CancellationTokenSource();

                workThread = new Thread(WorkThread)
                {
                    Name = GetType().Name + " : " + Gpu.Id,
                    IsBackground = true,
                    Priority = ThreadPriority.Lowest,
                };
                workThread.Start();
            }
        }

Usage Example

Example #1
0
        /// <summary>
        /// Invoked by the host to begin a new miner.
        /// </summary>
        /// <param name="context"></param>
        /// <param name="resource"></param>
        /// <returns></returns>
        public IMiner StartMiner(IMinerContext context, MinerResource resource)
        {
            var miner = new GpuMiner(context, (GpuResource)resource);
            miner.Start();

            return miner;
        }