Home > Net >  C # task
C # task

Time:10-08

Consult your c # task can be more thread set a background thread, like these two classes, respectively, when using,

CodePudding user response:

The thread is mononuclear multithreading

The task is multicore multithreaded multitasking,

CodePudding user response:

The task is the default background thread
If you want to modify for the front desk
Task. Factory. StartNew (()=& gt;
{
//set to the foreground thread
Thread. The CurrentThread. IsBackground=false;
});

CodePudding user response:

Both basic use in dealing with a time-consuming task, the task I more use in asynchronous processing, thread now basic no.

CodePudding user response:

refer to the second floor shenhua969 response:
task is the default background thread
If you want to modify for the front desk
Task. Factory. StartNew (()=& gt;
{
//set to the foreground thread
Thread. The CurrentThread. IsBackground=false;
});
ok, understand, thank you very much

CodePudding user response:

reference exception92 reply: 3/f
both basic use in dealing with a time-consuming task, the task I more use in asynchronous processing, thread now basically no.
I decided to later also need not
  •  Tags:  
  • C#
  • Related