Skip to main content
9 events
when toggle format what by license comment
Jun 27, 2018 at 15:55 comment added coder Then I should have std::priority_queue of Task.
Jun 27, 2018 at 13:44 comment added Edward The simplest way to do it is to always include a priority in Task and simply ignore it for scheduling algorithms that don't use it.
Jun 27, 2018 at 13:39 comment added coder Shortest Job First Preemptive and Round Robin. Can you share any link which have good program on inheritance and have user-defined header file?
Jun 27, 2018 at 13:32 comment added Edward The vector would have to contain PrioritizedTask objects. By definition, any scheduling mechanism that operates on priority would need to have access to the priority associated with each task. What other scheduling discipline are you thinking of using?
Jun 27, 2018 at 13:24 comment added coder We have std::vector of Task and std::priority_queue for priority, then how to bind these, knowing one is in base class and later is in derived class ?
Jun 27, 2018 at 11:38 comment added Edward One way to do it would be with a Task as a base class and a PrioritizedTask as a derived class. Also, if there are different scheduling mechanisms, you may not be able to keep the same interface for all of them. Here again, having a derived class may be one way to handle that.
Jun 27, 2018 at 8:23 vote accept coder
Jun 27, 2018 at 8:23 comment added coder You said priority should be part of Task, but I want to include scheduling.h in other scheduling algorithm there it is no use of priority. Then what to do?
Jun 27, 2018 at 0:41 history answered Edward CC BY-SA 4.0