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]
Other format: [Raw text]

Re: some issues relating to current_thread


Hi,

> The pending_map is only used in SMP configurations.
> Here the scheduler lock is implemented as a
spinlock,
> so only one CPU is executing in the scheduler at any
> one time. Again, by the time the lock is released,
> current_thread is set correctly.

In Linux, we are moving from coarse grain locking to
fine grained locking, but looking at schedlock
controlled approach for protection of state variables
in semaphore/mutex/... and the schedlock
implementation in eCos the coarseness is surprising
wrt "SMP implementation", more so because eCos is
supposed to be a RTOS. Please correct me if I am wrong
in this understanding of mine about eCos.

what I gather from the source code of ecos (current
cvs) that the schedlock approach not only protects the
state variable of (for example) a particular mutex say
mutex1 from simultaneous access by two threads trying
to lock the same mutex1 but also --

because of this schedlock approach in locking, one
thread trying to lock mutex1 on one CPU, will
unnecessarily get delayed in locking process because
another thread is trying to lock mutex2 on another
CPU.

Similar scenario happens when one thread is trying to
lock a mutex on one CPU and another thread trying to
down a semaphore on another CPU.

what i understand as the purpose of schedlock - is to
make sure thread switching doesn't happen in critical
zone. But the SMP implementation of schedlock, rather
more correct to say will be, the usage of schedlock is
causing unwanted delays across two unrelated
operations in a realtime os.

Won't it be better to use spinlock variables to
protect state variables of mutex/semaphore/.. in SMP
scenario, rather than schedlock?

brij



__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com

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


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