简体   繁体   中英

Thread or Task for long running operation

I need to have a thread in my app that will be long running (it is a job scheduler, Cron like) and will be most of the time sleeping. So not much CPU and IO. What would you advise me for this . Does a Task with long running option is the proper way to handle this or should I rely on the old fashion Thread and let that thread lives its own life?

A Task with the long running option is fine. It will create a new Thread in the background and you don't have to bother about the details.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM