[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [f-cpu] another DATE report




----- Original Message -----
From: Ben Franchuk <bfranchuk@jetnet.ab.ca>
To: <f-cpu@seul.org>
Sent: Monday, March 18, 2002 5:05 PM
Subject: Re: [f-cpu] another DATE report


> Christophe wrote:
> >
> > > Indeed, to avoid this problem when task switching, the usual workaround
is to
> > > disable interrupts before acquiring and after releasing the spinlock. But
> > such
> > > a thing is acceptable if time is very short between locking and
unlocking,
> > that
> > > is, not using a blocking function in-between.
> >
> > ... is to disable interrupts JUST before acquiring and to ENABLE interrupts
> > JUST after releasing the spinlock.
>
> I have to check a book on real time programing, but this style of task
> locking
> may not work on multiprocessors.

It is for avoiding task switch ONLY for the first processor which ACQUIRES the
spinlock. So it works for multiprocessors too, provided that other cpus are
really locked when they try to CAS the same location that the first processor
is being to CAS.

> I think the critical section algorithms for multi-tasking
> favor normal instructions over atomic ones.

Which critical session ? what are you speaking about ? spinlocks ? or
non-blocking primitives ? there is no critical sessions in non-blocking
primtives.

> Looking at software all you are doing is emulating

Which one ?

> edge triggered flip/flops in software and running
> asynchronous logic from them.
> The task switching and real time clock
> sync up the tasks.
> Synchronous logic is good for hardware, why not software?

Sorry, I don't understand at all what you mean :( could you be more explicit or
give me an example ?

> --
> Ben Franchuk - Dawn * 12/24 bit cpu *
> www.jetnet.ab.ca/users/bfranchuk/index.html
> *************************************************************
> To unsubscribe, send an e-mail to majordomo@seul.org with
> unsubscribe f-cpu       in the body. http://f-cpu.seul.org/

*************************************************************
To unsubscribe, send an e-mail to majordomo@seul.org with
unsubscribe f-cpu       in the body. http://f-cpu.seul.org/