[ECOS] Re: When Cyg_Scheduler_Implementation::add_thread() is called?

John Dallaway john@dallaway.org.uk
Mon Feb 22 14:29:00 GMT 2010


Hi Nodir

Nodir Kodirov wrote:

> I was doing some modifications in eCos kernel and I have a question
> about adding threads to the system. To be more specific when
> Cyg_Scheduler_Implementation::add_thread() is called?

It is called to add a thread to a "run queue" (not necessarily
implemented as a queue). The common thread support within the kernel
will add a thread to a run queue to make it schedulable. The scheduler
will choose a thread to run from those currently in the run queue
according to some scheduler-specific criteria.

> In the kernel source code (can be found on the line #200 of
> kernel\v3_0\src\sched\mlqueue.cxx for ML Sheduler) there is no comment
> for this function. So, I was thinking / expecting this function is
> called once thread is created, but when I checked this function is
> called several times, even though I create application with only one
> thread.

The kernel can optionally maintain a list of threads (ref
CYGVAR_KERNEL_THREADS_LIST). This is typically used for debugging
purposes. The thread list is unrelated to the scheduler run queue.

I hope this helps...

John Dallaway
eCos maintainer

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss



More information about the Ecos-discuss mailing list