This is the mail archive of the ecos-discuss@sourceware.org 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: Thread suspend when scheduler is locked.


Nick Garnett <nickg@calivar.com> writes:

> On 21/06/12 10:00, Sergei Organov wrote:
>> A few clarifications below.
>> 
>> Sergei Organov <osv@javad.com> writes:
>>> Hello,
>>>
>>> In the following sequence:
>>>
>>>   cyg_scheduler_lock();
>>>   cyg_thread_suspend(thread);
>>>
>>> the second call returns immediately that is very surprising. Is it a bug
>>> or fature?
>> 
>> 1. 'thread' is the current thread being executed so the suspend call asks
>>     thread for suspending itself.
>> 
>> 2. cyg_thread_delay(delay) returns immediately no matter what is 'delay'
>>    value.
>> 
>> 3. On the other hand, waiting on a primitive such as closed semaphore
>>    works fine.
>> 
>> Looks like a bug to me.
>
>

[...]

> Essentially locking the scheduler yourself is like running in a DSR,
> there is only a limited number of calls it makes sense to use, and their
> effects may be deferred until the scheduler lock returns to zero.

So, there is no way in eCos to just disable _preemption_? I.e.,
(temporarily) switch from preemptive to cooperative multi-threading?

-- Sergei.


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


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