Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C++ queue with dependencies

I am looking for a prototype or implementation for a queueing/scheduling system with dependencies between the individual tasks. To be more specific:

task_0, task_1, task_2, ... task 10 arrive at the queue. Tasks are http requests.

I want to send task_2 only if task_0 is completed. task_1 can be sent without expecting task_1 to complete but task_2 has to wait.

Ideas? Models that already exist and match this description?

like image 305
cateof Avatar asked Feb 04 '11 16:02

cateof


1 Answers

The queue can be topologically sorted.

http://en.wikipedia.org/wiki/Topological_sorting

http://www.cs.sunysb.edu/~algorith/files/topological-sorting.shtml

like image 71
Arun Avatar answered Oct 07 '22 21:10

Arun