- Added Policy::wants() and updated related code. Scheduler::get_ready_queue() still always returns a process queue...

git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@615 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
elvez 2006-06-09 16:51:53 +00:00
parent e5b90a39ad
commit 1e75fe91f1
9 changed files with 81 additions and 4 deletions

View file

@ -33,6 +33,12 @@
namespace sgpem
{
enum policy_sorts_type
{
policy_sorts_threads,
policy_sorts_processes
};
class Policy;
/** \brief
@ -44,6 +50,7 @@ namespace sgpem
class SG_DLLEXPORT Policy
{
public:
virtual ~Policy();
/**
@ -95,7 +102,17 @@ namespace sgpem
\return Time quantum for the policy.
*/
virtual int get_time_slice() const throw(UserInterruptException) = 0;
/**
Tell what kind of entities are scheduled by this policy.
Because it's a pure virtual method, must be re-implemented
in concrete derived classes.
\return A SortsType value identifying the desired type for the objects
composing the queue passed to the sort_queue method.
*/
virtual policy_sorts_type wants() const throw(UserInterruptException) = 0;
/**
Gets the parameters related with this policy.

View file

@ -49,6 +49,7 @@ Scheduler::get_instance()
SchedulableQueue*
Scheduler::get_ready_queue()
{
// FIXME return the correct queue accordingly to the value returned by Policy::wants()
return &_ready_queue;
}