[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Modulo function
kenkwok <email@example.com> writes:
> On looking at the code for SchedProcess::Init_impl, the problem
> seems to be that init_procs don't look at the mod.m or mod.off
> values. loop_procs and final_procs on the other hand do. I could
> easily rewrite the code for init_procs but I just thought I'd ask if
> there is a reason that the code was written the way it was?
just an oversight -- should be easy to replicate final_procs
functionality there -- I'll add it to my list, or accept your patches
if you get to it first..
> Furthermore, the GetCounter() function that is called in
> SchedProcess functions appears to depend on the "cntr" member
> declared in SchedProcess. Unfortunately, cntr is typically
> initialized to NULL and so GetCounter() will always return 0 and the
> Modulo function would fail. I've tried setting cntr to point to the
> epoch counter in the super_proc using
> taBase::SetPointer((TAPtr*)&cntr, &(super_proc->epoch)); This
> compiles but at runtime, cntr is still set to NULL. What's the
> proper way to set this pointer?
cntr gets initialized in SchedProcess::InitLinks, so it should be
set.. perhaps you have a process type that overloads InitLinks but
doesn't call SchedProcess::InitLinks..