1

I'm trying to build a timer queue in C to save the jobs that need to be processed based on time, is priority queue the best thing here or is there something else I need to look at?

The following is what I have,

job 1, start_time, time_to_exec, execute after 5 minutes 
job 2, start_time, time_to_exec, execute after 5 minutes 
Then new job came in 
job 3, start_time, time_to_exec, execute after 1 minutes 
...
and so on

and I'll be checking the first element every few microseconds.

start_time is the time before entering the queue.

time_to_exec is the time that will be used to insert the job into the queue

4

0 回答 0