This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: Question about Kernel? (Scheduler)
- From: Jesper Skov <jskov at redhat dot com>
- To: HuangQiang <jameshq at liverpool dot ac dot uk>
- Cc: eCos Discuss <ecos-discuss at sources dot redhat dot com>
- Date: 25 Apr 2002 08:36:19 +0200
- Subject: Re: [ECOS] Question about Kernel? (Scheduler)
- References: <KIEBICHBADHFCLGCKOPDEEOHCLAA.jameshq@liv.ac.uk>
On Tue, 2002-04-23 at 18:11, HuangQiang wrote:
> Hi all:
> I have got a problem in understanding the kernel of eCOS.
> While creating a user thread(cyg_thread_create()) an CYG_Thread class object
> pinter will be constructed, and in the object constructor it will call
> CYG_Scheduler::scheduler.register_thread(). The question: isn't an object of
> the CYG_Scheduler needed to be created? Also in the declaration of
> CYG_Scheduler, an member variable scheduler type of CYG_Scheduler(In other
> C++ program(like Visual C++) such definition can't be used at link time
> while it can't find the symbol why?). So isn't an object of CYG_Scheduler
> needed? why implement it in such
> way(CYG_Scheduler::scheduler.register_thread())? Why don't create an object
> of the CYG_Scheduler? I don't understand why this is done in such way.
> Could anybody give me some suggestion on it?
At a guess, CYG_Scheduler::scheduler is a static instantiation of the
scheduler. There's only need for one scheduler in the system, so each
thread should obviously not create one.
Jesper
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss