This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Re: When Cyg_Scheduler_Implementation::add_thread() is called?
- From: John Dallaway <john at dallaway dot org dot uk>
- To: Nodir Kodirov <nodir dot qodirov at gmail dot com>
- Cc: eCos Discussion <ecos-discuss at ecos dot sourceware dot org>
- Date: Mon, 22 Feb 2010 14:29:26 +0000
- Subject: [ECOS] Re: When Cyg_Scheduler_Implementation::add_thread() is called?
- References: <186ad4051002220522w592b40acn97c91e4c1e0c8b2f@mail.gmail.com> <186ad4051002220523s60672879oe99e4c0ad33e30b6@mail.gmail.com>
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