- Fix ``make distcheck''
git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@1051 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
parent
8271a880b2
commit
f7eb44bf64
|
@ -360,6 +360,8 @@ glade_DATA = \
|
|||
glade/jump-to-dialog.glade \
|
||||
glade/main-window.glade
|
||||
|
||||
EXTRA_DIST += $(glade_DATA)
|
||||
|
||||
# ############################################################
|
||||
#
|
||||
# source : templates
|
||||
|
@ -539,7 +541,6 @@ endif #~ if COND_TESTS
|
|||
# ############################################################
|
||||
|
||||
noinst_DATA += \
|
||||
src/testsuite/scheduling-wizards \
|
||||
src/testsuite/scheduling-wizards/wizard-deadlock-test \
|
||||
src/testsuite/scheduling-wizards/wizard-gap-fail \
|
||||
src/testsuite/scheduling-wizards/wizard-assert-fail \
|
||||
|
@ -559,3 +560,6 @@ noinst_DATA += \
|
|||
src/testsuite/scheduling-wizards/environments/Porno_priority_inversion.xgp \
|
||||
src/testsuite/scheduling-wizards/environments/ScuolaDiMileto_gap_fail.xgp \
|
||||
src/testsuite/scheduling-wizards/environments/DiscWorld_unblock.xgp
|
||||
|
||||
EXTRA_DIST += $(noinst_DATA)
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ AC_CONFIG_AUX_DIR(config)
|
|||
AC_CANONICAL_TARGET
|
||||
|
||||
dnl starting automake
|
||||
AM_INIT_AUTOMAKE([dejagnu dist-bzip2])
|
||||
AM_INIT_AUTOMAKE([dejagnu dist-bzip2 subdir-objects])
|
||||
|
||||
dnl gettext & libtool
|
||||
AC_PROG_LIBTOOL
|
||||
|
|
|
@ -42,7 +42,7 @@ AC_CONFIG_AUX_DIR(config)
|
|||
AC_CANONICAL_TARGET
|
||||
|
||||
dnl starting automake
|
||||
AM_INIT_AUTOMAKE([dejagnu dist-bzip2])
|
||||
AM_INIT_AUTOMAKE([dejagnu dist-bzip2 subdir-objects])
|
||||
|
||||
dnl gettext & libtool
|
||||
AC_PROG_LIBTOOL
|
||||
|
|
|
@ -42,7 +42,7 @@ AC_CONFIG_AUX_DIR(config)
|
|||
AC_CANONICAL_TARGET
|
||||
|
||||
dnl starting automake
|
||||
AM_INIT_AUTOMAKE([dejagnu dist-bzip2])
|
||||
AM_INIT_AUTOMAKE([dejagnu dist-bzip2 subdir-objects])
|
||||
|
||||
dnl gettext & libtool
|
||||
AC_PROG_LIBTOOL
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
src/xml_serializer.cc
|
||||
src/xml_serializer_factory.cc
|
||||
src/xml_visitor.cc
|
||||
src/testsuite/test-xml_serializer.cc
|
||||
src/plugin.cc
|
||||
|
|
|
@ -27,7 +27,6 @@ src/backend/sgpemv2/templates/sequences.tcc
|
|||
src/backend/sgpemv2/templates/singleton.tcc
|
||||
src/backend/sgpemv2/templates/parameter.tcc
|
||||
src/backend/sgpemv2/templates/smartp.tcc
|
||||
src/backend/sgpemv2/templates/prova.cc
|
||||
src/backend/sgpemv2/templates/deletor.tcc
|
||||
src/backend/policy_parameters.cc
|
||||
src/backend/resource.cc
|
||||
|
@ -50,7 +49,6 @@ src/backend/static_process.cc
|
|||
src/backend/scheduler.cc
|
||||
src/backend/request.cc
|
||||
src/backend/simulation.cc
|
||||
src/backend/global_preferences_serializer.cc
|
||||
src/backend/invalid_plugin_exception.cc
|
||||
src/backend/cpu_policy.cc
|
||||
src/backend/module.cc
|
||||
|
@ -75,14 +73,9 @@ src/text_simulation.cc
|
|||
src/testsuite/test-holt_widget.cc
|
||||
src/testsuite/test-history.cc
|
||||
src/testsuite/test-simulation_widget.cc
|
||||
src/testsuite/stubs/policy_manager.cc
|
||||
src/testsuite/stubs/prrpolicy.cc
|
||||
src/testsuite/stubs/history.cc
|
||||
src/testsuite/test-key_file.cc
|
||||
src/testsuite/test-cairo_widget.cc
|
||||
src/testsuite/test-stepforward.cc
|
||||
src/testsuite/test-global_preferences_serialization.cc
|
||||
src/testsuite/test-parse_command.cc
|
||||
src/jump_to_dialog.cc
|
||||
src/resources_widget.cc
|
||||
src/configure_policy_dialog.cc
|
||||
|
|
|
@ -8,7 +8,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: matteo@member.fsf.org\n"
|
||||
"POT-Creation-Date: 2006-09-07 18:52+0200\n"
|
||||
"POT-Creation-Date: 2006-09-07 20:35+0200\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
|
@ -111,29 +111,29 @@ msgstr ""
|
|||
msgid "<b> } at instant </b>"
|
||||
msgstr ""
|
||||
|
||||
#: src/simulation_controller.cc:194 src/jump_to_dialog.cc:108
|
||||
#: src/simulation_controller.cc:194 src/jump_to_dialog.cc:106
|
||||
msgid "<b>The selected user CPU policy stopped before returning:</b>\n"
|
||||
msgstr ""
|
||||
|
||||
#: src/simulation_controller.cc:201 src/jump_to_dialog.cc:115
|
||||
#: src/simulation_controller.cc:201 src/jump_to_dialog.cc:113
|
||||
msgid ""
|
||||
"<b>The selected user CPU policy was malformed and failed to sort the queue:</"
|
||||
"b>\n"
|
||||
msgstr ""
|
||||
|
||||
#: src/simulation_controller.cc:213 src/jump_to_dialog.cc:127
|
||||
#: src/simulation_controller.cc:213 src/jump_to_dialog.cc:125
|
||||
msgid " [EE] Fatal error. Impossible to deactivate the policy in "
|
||||
msgstr ""
|
||||
|
||||
#: src/simulation_controller.cc:214 src/jump_to_dialog.cc:128
|
||||
#: src/simulation_controller.cc:214 src/jump_to_dialog.cc:126
|
||||
msgid " [EE] "
|
||||
msgstr ""
|
||||
|
||||
#: src/simulation_controller.cc:221 src/jump_to_dialog.cc:135
|
||||
#: src/simulation_controller.cc:221 src/jump_to_dialog.cc:132
|
||||
msgid "<b>No active policy selected:</b>\n"
|
||||
msgstr ""
|
||||
|
||||
#: src/simulation_controller.cc:228 src/jump_to_dialog.cc:142
|
||||
#: src/simulation_controller.cc:228 src/jump_to_dialog.cc:139
|
||||
msgid "<b>Unexpected error</b>:\n"
|
||||
msgstr ""
|
||||
|
||||
|
@ -254,7 +254,7 @@ msgstr ""
|
|||
msgid "at "
|
||||
msgstr ""
|
||||
|
||||
#: src/simulation_widget.cc:156
|
||||
#: src/simulation_widget.cc:159
|
||||
msgid ""
|
||||
"Nothing to see here... add some processes! Right-click on the Schedulables "
|
||||
"view in this window."
|
||||
|
|
|
@ -1,130 +0,0 @@
|
|||
// src/global_preferences.cc - Copyright 2005, 2006, University
|
||||
// of Padova, dept. of Pure and Applied
|
||||
// Mathematics
|
||||
//
|
||||
// This file is part of SGPEMv2.
|
||||
//
|
||||
// This is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation; either version 2 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// SGPEMv2 is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with SGPEMv2; if not, write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
#include "config.h"
|
||||
#include <sgpemv2/key_file.hh>
|
||||
#include "global_preferences_serializer.hh"
|
||||
#include <sstream>
|
||||
|
||||
namespace sgpem
|
||||
{
|
||||
|
||||
GlobalPreferencesSerializer::GlobalPreferencesSerializer(GlobalPreferences &gp)
|
||||
: _globalPreferences(gp)
|
||||
{}
|
||||
|
||||
|
||||
|
||||
void
|
||||
GlobalPreferencesSerializer::file_read(const Glib::ustring& filename)
|
||||
{
|
||||
_globalPreferences._mod_dirs.clear();
|
||||
_globalPreferences._pol_dirs.clear();
|
||||
KeyFile::file_read(filename);
|
||||
// read modules directories
|
||||
{
|
||||
const Glib::ustring* val = search_value(Glib::ustring("modules-dir-number"));
|
||||
if (val)
|
||||
{
|
||||
std::istringstream istr(val->c_str());
|
||||
int n;
|
||||
istr >> n;
|
||||
for (int i = 1; i <= n; i++)
|
||||
{
|
||||
std::ostringstream ostr;
|
||||
ostr << "modules-dir-" << i << std::ends;
|
||||
Glib::ustring key(ostr.str());
|
||||
val = search_value(key);
|
||||
if (val)
|
||||
{
|
||||
_globalPreferences.add_modules_dir(*val);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// read policies directories
|
||||
{
|
||||
const Glib::ustring* val = search_value(Glib::ustring("policies-dir-number"));
|
||||
if (val)
|
||||
{
|
||||
std::istringstream istr(val->c_str());
|
||||
int n;
|
||||
istr >> n;
|
||||
for (int i = 1; i <= n; i++)
|
||||
{
|
||||
std::ostringstream ostr;
|
||||
ostr << "policies-dir-" << i << std::ends;
|
||||
Glib::ustring key(ostr.str());
|
||||
val = search_value(key);
|
||||
if (val)
|
||||
{
|
||||
_globalPreferences.add_policies_dir(*val);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
GlobalPreferencesSerializer::file_write(const Glib::ustring& filename)
|
||||
{
|
||||
// add modules directories
|
||||
{
|
||||
GlobalPreferences::dir_iterator iter = _globalPreferences.modules_dir_begin();
|
||||
int n = 0;
|
||||
while (iter != _globalPreferences.modules_dir_end())
|
||||
{
|
||||
std::ostringstream ostr;
|
||||
n++;
|
||||
ostr << "modules-dir-" << n << std::ends;
|
||||
Glib::ustring key(ostr.str());
|
||||
insert_key_value(key, (*iter));
|
||||
++iter;
|
||||
}
|
||||
Glib::ustring key("modules-dir-number");
|
||||
std::ostringstream ostr;
|
||||
ostr << n << std::ends;
|
||||
Glib::ustring value(ostr.str());
|
||||
insert_key_value(key, value);
|
||||
}
|
||||
// add policies directories
|
||||
{
|
||||
GlobalPreferences::dir_iterator iter = _globalPreferences.policies_dir_begin();
|
||||
int n = 0;
|
||||
while (iter != _globalPreferences.policies_dir_end())
|
||||
{
|
||||
std::ostringstream ostr;
|
||||
n++;
|
||||
ostr << "policies-dir-" << n << std::ends;
|
||||
Glib::ustring key(ostr.str());
|
||||
insert_key_value(key, (*iter));
|
||||
++iter;
|
||||
}
|
||||
Glib::ustring key("policies-dir-number");
|
||||
std::ostringstream ostr;
|
||||
ostr << n << std::ends;
|
||||
Glib::ustring value(ostr.str());
|
||||
insert_key_value(key, value);
|
||||
}
|
||||
|
||||
KeyFile::file_write(filename);
|
||||
}
|
||||
}
|
|
@ -1,113 +0,0 @@
|
|||
// src/testsuite/test-stepforward.cc - Copyright 2005, 2006, University
|
||||
// of Padova, dept. of Pure and Applied
|
||||
// Mathematics
|
||||
//
|
||||
// This file is part of SGPEMv2.
|
||||
//
|
||||
// This is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation; either version 2 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// SGPEMv2 is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with SGPEMv2; if not, write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
|
||||
#include <sgpemv2/history.hh>
|
||||
|
||||
using namespace sgpem;
|
||||
|
||||
|
||||
memory::smart_ptr<sgpem::DynamicSchedulable>
|
||||
History::get_scheduled_at(int time) const
|
||||
{
|
||||
using namespace memory;
|
||||
smart_ptr<DynamicSchedulable> scheduled_at = smart_ptr<DynamicSchedulable>();
|
||||
if (0 <= time && time <= _total_time_elapsed)
|
||||
{
|
||||
smart_ptr<ReadyQueue> sl = get_simulation_status_at(time);
|
||||
bool found = false;
|
||||
bool invalid = sl == smart_ptr<ReadyQueue>();
|
||||
for (uint i = 0; !found && !invalid && i < sl->size(); i++)
|
||||
{
|
||||
const DynamicSchedulable* ss = sl->get_item_at(i);
|
||||
if ((bool)ss && ss->get_state() == DynamicSchedulable::state_running)
|
||||
{
|
||||
scheduled_at = smart_ptr<DynamicSchedulable>(new DynamicSchedulable(*(ss)));
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return scheduled_at;
|
||||
}
|
||||
|
||||
|
||||
memory::smart_ptr<sgpem::ReadyQueue>
|
||||
History::get_simulation_status_at(int time) const
|
||||
{
|
||||
using namespace memory;
|
||||
smart_ptr<ReadyQueue> simulation_status_at = smart_ptr<ReadyQueue>();
|
||||
if (0 <= time && time <= _total_time_elapsed)
|
||||
{
|
||||
if (_slice == memory::smart_ptr<Slice>())
|
||||
std::cout << "History::get_simulation_status_at.NULL.error";
|
||||
else
|
||||
simulation_status_at = memory::smart_ptr<ReadyQueue>
|
||||
(
|
||||
new ReadyQueue
|
||||
(
|
||||
*(_slice->get_simulation_status())
|
||||
)
|
||||
);
|
||||
}
|
||||
return simulation_status_at;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
History::get_current_time() const
|
||||
{
|
||||
return _total_time_elapsed;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
History::enqueue_slice(const sgpem::ReadyQueue& status)
|
||||
{
|
||||
_slice = memory::smart_ptr<Slice>(new Slice(_total_time_elapsed, 1, status));
|
||||
_total_time_elapsed++;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
History::truncate_at(int instant)
|
||||
{
|
||||
//std::cout << "\nRecreating a Singleton History";
|
||||
_slice = memory::smart_ptr<Slice>();
|
||||
_total_time_elapsed = -1;
|
||||
}
|
||||
|
||||
|
||||
History&
|
||||
History::get_instance()
|
||||
{
|
||||
if (History::_instance == NULL)
|
||||
History::_instance = new History();
|
||||
return *History::_instance;
|
||||
}
|
||||
|
||||
|
||||
History::History()
|
||||
{
|
||||
_slice = memory::smart_ptr<Slice>();
|
||||
_total_time_elapsed = -1;
|
||||
}
|
||||
|
||||
|
||||
History * History::_instance = NULL;
|
|
@ -1,111 +0,0 @@
|
|||
// src/testsuite/test-stepforward.cc - Copyright 2005, 2006, University
|
||||
// of Padova, dept. of Pure and Applied
|
||||
// Mathematics
|
||||
//
|
||||
// This file is part of SGPEMv2.
|
||||
//
|
||||
// This is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation; either version 2 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// SGPEMv2 is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with SGPEMv2; if not, write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
|
||||
#ifndef HISTORY_HH
|
||||
#define HISTORY_HH 1
|
||||
|
||||
#include "backend/observed_subject.hh"
|
||||
#include "backend/slice.hh"
|
||||
#include <sgpemv2/ready_queue.hh>
|
||||
#include "templates/smartp.tcc"
|
||||
#include <iostream>
|
||||
|
||||
/*
|
||||
#include <glibmm/module.h> // ??
|
||||
#include <cassert>
|
||||
#include <string>
|
||||
#include "config.h"
|
||||
#include "gettext.h"
|
||||
#include "glibmm/ustring.h"
|
||||
#include <vector>
|
||||
|
||||
#include "backend/static_process.hh"
|
||||
|
||||
|
||||
#include "backend/dynamic_schedulable.hh"
|
||||
|
||||
#include <sgpemv2/user_interrupt_exception.hh>
|
||||
#include "backend/policy.hh"
|
||||
|
||||
#include "prrpolicy.cc"
|
||||
#include <iostream>
|
||||
*/
|
||||
|
||||
namespace sgpem
|
||||
{
|
||||
|
||||
/** an History stub, should only save the last state included.
|
||||
*/
|
||||
class History : public ObservedSubject
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
/** Returns the DynamicSchedulable of the schedulable
|
||||
* which was running at the time, if any.
|
||||
*/
|
||||
memory::smart_ptr<sgpem::DynamicSchedulable>
|
||||
get_scheduled_at(int time) const;
|
||||
|
||||
|
||||
/** Returns the last recorded instant, but may raise an error.
|
||||
*/
|
||||
memory::smart_ptr<sgpem::ReadyQueue>
|
||||
get_simulation_status_at(int time) const;
|
||||
|
||||
|
||||
/** Returns the total time recorded.
|
||||
*/
|
||||
int
|
||||
get_current_time() const;
|
||||
|
||||
|
||||
/** Extends the recorded history by one unit, overwriting the old value
|
||||
*/
|
||||
void
|
||||
enqueue_slice(const sgpem::ReadyQueue& status);
|
||||
|
||||
|
||||
/** STUB: THIS FEATURE IS NOT AVAILABLE
|
||||
*/
|
||||
void
|
||||
truncate_at(int instant);
|
||||
|
||||
|
||||
/** Returns the singleton instance.
|
||||
*/
|
||||
static History&
|
||||
get_instance();
|
||||
|
||||
|
||||
private:
|
||||
History();
|
||||
|
||||
static History * _instance;
|
||||
int _total_time_elapsed;
|
||||
memory::smart_ptr<Slice> _slice;
|
||||
};
|
||||
|
||||
|
||||
} //~ namespace sgpem
|
||||
|
||||
#endif
|
|
@ -1,53 +0,0 @@
|
|||
// src/testsuite/test-stepforward.cc - Copyright 2005, 2006, University
|
||||
// of Padova, dept. of Pure and Applied
|
||||
// Mathematics
|
||||
//
|
||||
// This file is part of SGPEMv2.
|
||||
//
|
||||
// This is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation; either version 2 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// SGPEMv2 is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with SGPEMv2; if not, write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
#include "policy_manager.hh"
|
||||
|
||||
using namespace sgpem;
|
||||
|
||||
PolicyManager::PolicyManager()
|
||||
{}
|
||||
|
||||
PolicyManager&
|
||||
PolicyManager::get_registered_manager()
|
||||
{
|
||||
if (_registered == NULL)
|
||||
_registered = new PolicyManager();
|
||||
return *_registered;
|
||||
}
|
||||
|
||||
Policy&
|
||||
PolicyManager::get_policy()
|
||||
{
|
||||
return PRRPolicy::get_instance();
|
||||
}
|
||||
|
||||
void
|
||||
PolicyManager::init()
|
||||
{}
|
||||
|
||||
PolicyManager::~PolicyManager()
|
||||
{
|
||||
if (_registered == this) _registered = NULL;
|
||||
}
|
||||
|
||||
|
||||
PolicyManager*
|
||||
PolicyManager::_registered = NULL;
|
|
@ -1,73 +0,0 @@
|
|||
// src/testsuite/test-stepforward.cc - Copyright 2005, 2006, University
|
||||
// of Padova, dept. of Pure and Applied
|
||||
// Mathematics
|
||||
//
|
||||
// This file is part of SGPEMv2.
|
||||
//
|
||||
// This is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation; either version 2 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// SGPEMv2 is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with SGPEMv2; if not, write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
#ifndef POLICY_MANAGER_HH
|
||||
#define POLICY_MANAGER_HH 1
|
||||
|
||||
#include "prrpolicy.hh"
|
||||
/*
|
||||
#include <glibmm/module.h> // ??
|
||||
#include <cassert>
|
||||
#include <string>
|
||||
#include "config.h"
|
||||
#include "gettext.h"
|
||||
#include "glibmm/ustring.h"
|
||||
#include <vector>
|
||||
#include <iostream>
|
||||
#include "backend/static_process.hh"
|
||||
#include "backend/observed_subject.hh"
|
||||
#include <sgpemv2/ready_queue.hh>
|
||||
#include "backend/dynamic_schedulable.hh"
|
||||
#include "templates/smartp.tcc"
|
||||
#include <sgpemv2/user_interrupt_exception.hh>
|
||||
#include "backend/policy.hh"
|
||||
#include "backend/slice.hh"
|
||||
#include "prrpolicy.cc"
|
||||
#include <iostream>
|
||||
*/
|
||||
|
||||
namespace sgpem
|
||||
{
|
||||
/** A policyManager stub, provides access to the PRRPolicy.
|
||||
*/
|
||||
class PolicyManager
|
||||
{
|
||||
public:
|
||||
|
||||
PolicyManager();
|
||||
|
||||
static PolicyManager&
|
||||
get_registered_manager();
|
||||
|
||||
virtual Policy&
|
||||
get_policy();
|
||||
|
||||
virtual void
|
||||
init();
|
||||
|
||||
virtual
|
||||
~PolicyManager();
|
||||
|
||||
private:
|
||||
static PolicyManager* _registered;
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
|
@ -1,121 +0,0 @@
|
|||
// src/testsuite/test-stepforward.cc - Copyright 2005, 2006, University
|
||||
// of Padova, dept. of Pure and Applied
|
||||
// Mathematics
|
||||
//
|
||||
// This file is part of SGPEMv2.
|
||||
//
|
||||
// This is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation; either version 2 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// SGPEMv2 is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with SGPEMv2; if not, write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
#include "prrpolicy.hh"
|
||||
|
||||
using namespace sgpem;
|
||||
|
||||
PRRPolicy::PRRPolicy()
|
||||
{
|
||||
_instance = this;
|
||||
}
|
||||
|
||||
PRRPolicy::PRRPolicy(int quantum)
|
||||
: _quantum(quantum)
|
||||
{
|
||||
_instance = this;
|
||||
}
|
||||
|
||||
Policy&
|
||||
PRRPolicy::get_instance()
|
||||
{
|
||||
if (_instance == NULL) _instance = new PRRPolicy(3); // quantum size
|
||||
return *_instance;
|
||||
}
|
||||
|
||||
|
||||
PRRPolicy::~PRRPolicy()
|
||||
{}
|
||||
|
||||
void
|
||||
PRRPolicy::configure()
|
||||
throw(UserInterruptException)
|
||||
{}
|
||||
|
||||
void
|
||||
PRRPolicy::sort_queue() const
|
||||
throw(UserInterruptException)
|
||||
{
|
||||
ReadyQueue* local_sl = Scheduler::get_instance().get_ready_queue();
|
||||
for (uint useless = 0; useless < local_sl->size(); useless++)
|
||||
for (uint i = 0; i < local_sl->size() - 1; i++)
|
||||
if
|
||||
(
|
||||
local_sl->get_item_at(i)->get_schedulable()->get_priority() >
|
||||
local_sl->get_item_at(i + 1)->get_schedulable()->get_priority()
|
||||
)
|
||||
local_sl->swap(i, i + 1);
|
||||
}
|
||||
|
||||
void
|
||||
PRRPolicy::activate()
|
||||
{}
|
||||
|
||||
void
|
||||
PRRPolicy::deactivate()
|
||||
{}
|
||||
|
||||
int
|
||||
PRRPolicy::get_id() const
|
||||
{
|
||||
return 42;
|
||||
}
|
||||
|
||||
sgpem::policy_sorts_type
|
||||
PRRPolicy::wants() const
|
||||
throw(UserInterruptException)
|
||||
{
|
||||
return policy_sorts_processes;
|
||||
}
|
||||
|
||||
Glib::ustring
|
||||
PRRPolicy::get_name() const
|
||||
{
|
||||
return "42";
|
||||
}
|
||||
|
||||
Glib::ustring
|
||||
PRRPolicy::get_description() const
|
||||
{
|
||||
return "42";
|
||||
}
|
||||
|
||||
bool
|
||||
PRRPolicy::is_pre_emptive() const
|
||||
throw(UserInterruptException)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
PRRPolicy::get_time_slice() const
|
||||
throw(UserInterruptException)
|
||||
{
|
||||
return _quantum;
|
||||
}
|
||||
|
||||
PolicyParameters&
|
||||
PRRPolicy::get_parameters()
|
||||
{
|
||||
return _parameters;
|
||||
}
|
||||
|
||||
Policy*
|
||||
PRRPolicy::_instance = NULL;
|
|
@ -1,129 +0,0 @@
|
|||
// src/testsuite/test-stepforward.cc - Copyright 2005, 2006, University
|
||||
// of Padova, dept. of Pure and Applied
|
||||
// Mathematics
|
||||
//
|
||||
// This file is part of SGPEMv2.
|
||||
//
|
||||
// This is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation; either version 2 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// SGPEMv2 is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with SGPEMv2; if not, write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
#ifndef PRRPOLICY_HH
|
||||
#define PRRPOLICY_HH 1
|
||||
|
||||
#include "backend/policy.hh"
|
||||
#include <sgpemv2/user_interrupt_exception.hh>
|
||||
#include <sgpemv2/ready_queue.hh>
|
||||
#include <sgpemv2/scheduler.hh>
|
||||
#include "glibmm/ustring.h"
|
||||
|
||||
/*
|
||||
#include <string>
|
||||
#include "config.h"
|
||||
#include "gettext.h"
|
||||
|
||||
#include <vector>
|
||||
#include <iostream>
|
||||
#include "backend/static_process.hh"
|
||||
#include "backend/observed_subject.hh"
|
||||
|
||||
#include "backend/dynamic_schedulable.hh"
|
||||
#include "templates/smartp.tcc"
|
||||
#include <sgpemv2/user_interrupt_exception.hh>
|
||||
|
||||
#include "backend/slice.hh"
|
||||
|
||||
#include <iostream>
|
||||
*/
|
||||
|
||||
namespace sgpem
|
||||
{
|
||||
/** An hard-coded Priority Round Robin policy
|
||||
* It's actually called PRRPolicy, altough my personal taste would have suggested
|
||||
* naming it
|
||||
* Prioriy-Reliant Roughly-Realized Recently-Reimplemented Round-Robin Policy,
|
||||
* i.e. PRRRRRRR-Policy.
|
||||
* it adds a new constructor taking the quantum size (time slice)
|
||||
*/
|
||||
class PRRPolicy : public Policy
|
||||
{
|
||||
public:
|
||||
|
||||
PRRPolicy();
|
||||
|
||||
PRRPolicy(int quantum);
|
||||
|
||||
static Policy&
|
||||
get_instance();
|
||||
|
||||
virtual
|
||||
~PRRPolicy();
|
||||
|
||||
virtual void
|
||||
configure()
|
||||
throw(UserInterruptException);
|
||||
|
||||
virtual void
|
||||
sort_queue() const
|
||||
throw(UserInterruptException);
|
||||
|
||||
|
||||
virtual void
|
||||
activate();
|
||||
|
||||
virtual void
|
||||
deactivate();
|
||||
|
||||
|
||||
virtual int
|
||||
get_id() const;
|
||||
|
||||
virtual sgpem::policy_sorts_type
|
||||
wants() const
|
||||
throw(UserInterruptException);
|
||||
|
||||
|
||||
virtual Glib::ustring
|
||||
get_name() const;
|
||||
|
||||
virtual Glib::ustring
|
||||
get_description() const;
|
||||
|
||||
virtual bool
|
||||
is_pre_emptive() const
|
||||
throw(UserInterruptException);
|
||||
|
||||
virtual int
|
||||
get_time_slice() const
|
||||
throw(UserInterruptException);
|
||||
|
||||
|
||||
virtual PolicyParameters&
|
||||
get_parameters();
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
PolicyParameters _parameters;
|
||||
int _id;
|
||||
int _quantum;
|
||||
|
||||
private:
|
||||
|
||||
static Policy* _instance;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue