Home » Community » Newbie corner » Simple Thread (simple thread example.)
Re: Simple Thread [message #55042 is a reply to message #55040] |
Tue, 06 October 2020 09:33  |
 |
mirek
Messages: 14267 Registered: November 2005
|
Ultimate Member |
|
|
lovmy wrote on Tue, 06 October 2020 08:15Hello !
Thank you for your help, i need to learn more on lambda expression...
Just a question, what's the différence between thread and CoWork ?
Have a nice day !
CoWork is basically an interface to thread pool. That is a pool of waiting threads that get used on demand - this saves you the costs of creating and exiting threads.
CoWork allows you to schedule any number of jobs to be processed, possibly in parallel and then wait for all of them to be done.
That said, for most of work, CoWork is now superseded by CoDo, which basically starts the same job, usually represented by lambda, on as many CPU cores as possible.
Long story short:
If you are after improving performance by parallelizing work, check CoDo first (most iterations are best done in CoDo).
If CoDo is not suitable, check CoWork (e.g. quick-sort cannot be implemented with CoDo nicely, but can be implemented with CoWork).
For some background tasks, consider Async.
If you are after something else entirely, like long running background tasks (e.g. a thread that backups data in your application periodically), use raw Thread.
Eh, that was not so short after all 
Mirek
|
|
|
Goto Forum:
Current Time: Sun Aug 24 13:40:52 CEST 2025
Total time taken to generate the page: 0.05004 seconds
|