This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: ecos 1.3.1


Rafael Rodríguez Velilla wrote:
> 
>   In the implementation of MLQUEUE scheduler I've found that the method
> rem_thread doesn't check if the thread that is being removed is the
> "current_thread". Shouldn't this check be done in order to raise
> "need_reschedule" when that happens?
>   In the BITMAP scheme it is done.

I believe that the kernel expects the caller of rem_thread to always
manipulate the thread state to be something other than RUNNING. And given
that rem_thread should always be called with the scheduler locked, this
should force a reschedule. The bitmap scheduler is probably just overly
zealous. Nick, comments?

> Another little thing, in the method add_thread I find the following
> code:
> if (thread->queue != NULL)
> {
>    thread->queue->remove(thread);
>    thread->queue=NULL;
> }
> 
>  Isn't it true that when remove is invoqued, the member queue of the
> thread used as a parameter finishes pointing to NULL? So thread->queue
> is innecessary.

Looks like it. Nick, any comments before I change it?

Jifl
-- 
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]