- Let the user disable the new GCC 4.0 visibility support
from configure. This is mainly there for buggy compilers / binutils. git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@715 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
parent
4108b39c09
commit
fcc9e93827
5 changed files with 103 additions and 53 deletions
|
@ -29,7 +29,9 @@
|
|||
|
||||
#include <glibmm/thread.h>
|
||||
|
||||
#include <cassert>
|
||||
#include <memory>
|
||||
|
||||
using namespace std;
|
||||
using namespace sgpem;
|
||||
|
||||
|
@ -56,6 +58,22 @@ collect_threads(const std::vector<Process*>& procs,
|
|||
}
|
||||
}
|
||||
|
||||
static void prepare_ready_queue(ConcreteEnvironment& snapshot,
|
||||
std::vector<DynamicThread*>& all_threads)
|
||||
{
|
||||
typedef std::vector<DynamicThread*> Threads;
|
||||
ReadyQueue& queue = snapshot.get_sorted_queue();
|
||||
assert(queue.size() == 0);
|
||||
for(Threads::const_iterator it = all_threads.begin();
|
||||
it != all_threads.end(); it++)
|
||||
{
|
||||
if((*it)->get_state() == Schedulable::state_ready)
|
||||
all_threads.push_back(*it);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// ---------------------------------------------------------
|
||||
|
||||
|
||||
|
@ -201,8 +219,7 @@ Scheduler::step_forward(History& history, Policy& cpu_policy) throw(UserInterrup
|
|||
// (is it visible enough for you?)
|
||||
|
||||
|
||||
ReadyQueue& ready_queue = new_snapshot->get_sorted_queue();
|
||||
prepare_ready_queue(ready_queue);
|
||||
prepare_ready_queue(*new_snapshot, all_threads);
|
||||
try
|
||||
{
|
||||
// Temporarily set the _ready_queue param and the _policy one for
|
||||
|
@ -210,7 +227,6 @@ Scheduler::step_forward(History& history, Policy& cpu_policy) throw(UserInterrup
|
|||
_policy = &cpu_policy;
|
||||
_ready_queue = &new_snapshot->get_sorted_queue();
|
||||
|
||||
|
||||
// ?. Use the policy to sort the queue
|
||||
|
||||
// FIXME: how does it get the queue?
|
||||
|
@ -218,10 +234,11 @@ Scheduler::step_forward(History& history, Policy& cpu_policy) throw(UserInterrup
|
|||
}
|
||||
catch(UserInterruptException& e)
|
||||
{
|
||||
// Reset values that the policy doesn't need anymore
|
||||
_policy = NULL;
|
||||
_ready_queue = NULL;
|
||||
// ^^^^^
|
||||
// Do we need to update something else?
|
||||
|
||||
// Do we need to update/reset something else?
|
||||
|
||||
// Going up unwinding the stack, tell:
|
||||
// - the user that the policy sucks
|
||||
|
@ -232,14 +249,10 @@ Scheduler::step_forward(History& history, Policy& cpu_policy) throw(UserInterrup
|
|||
// append the new snapshot...
|
||||
// ...and remember to release the auto_ptr!
|
||||
concrete_history.append_new_environment(new_snapshot.release());
|
||||
|
||||
// Reset values that the policy doesn't need anymore
|
||||
_policy = NULL;
|
||||
_ready_queue = NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void
|
||||
Scheduler::prepare_ready_queue(ReadyQueue& queue)
|
||||
{
|
||||
|
||||
}
|
||||
|
|
|
@ -87,9 +87,7 @@ namespace sgpem
|
|||
*/
|
||||
Policy& get_policy();
|
||||
|
||||
private:
|
||||
void prepare_ready_queue(ReadyQueue& queue);
|
||||
|
||||
private:
|
||||
Scheduler(); //private constructor.
|
||||
|
||||
ReadyQueue* _ready_queue;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue