Home > Back-end >  Timing tasks and threads
Timing tasks and threads

Time:09-22

Sweep timing task every time table 10 data now, (according to the four state) to carry out corresponding to the interaction of 4 request, used to be synchronized, now converted into 4 timing task to perform different tasks, each time each time the task run 10, or a regular task runs four thread each thread runs a task, a total of 10 tasks,,, time is a minute time, now I don't know which is fast (a data of four states are performed and the data is complete)

CodePudding user response:

Look at your machine number of threads, multicore multi-threading, multiple tasks in parallel run fast ah, of course, of course, a former problem, large amount of data, after cannot achieve maximum database I/O,

CodePudding user response:

General multiple timing task is to perform different time zones, each time the task is a thread to operate, so and you also declare four threads to run this stuff is the same, and I think will be more expensive,
Four tasks=4 thread model, only 4 thread work
Four tasks=4 timing task model, four threads + 4 timing task

Feeling is the second efficiency is low, if you have different opinions, welcome to discuss,


I feel like your this kind of demand, with a task + multithreading can regularly, it is not necessary to multiple tasks regularly
  • Related