You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sandesh Kota edited this page Mar 18, 2019
·
23 revisions
Task
Creating a Task in parallel (depends on # of cores also)
Single core: threads are shared - Still best for responsiveness (ex: main thread is for UI)
Multi Core: threads run in parallel
Only the main thread can update UI
using System.Threading.Tasks;
Task t = new Task( () => {
// code
});
t.Start();
// another way to create and start task
task tnew = task.Factory.StartNew( _code_ );