Strictly atomic operations

Sebastian Huber sebastian.huber at embedded-brains.de
Mon Jan 23 08:37:48 UTC 2017


Hello Matt,

On 20/01/17 20:12, Matt Rippa wrote:
> Greetings,
>
> In VxWorks 5.5 we use taskLock()/taskUnlock() to stop the possibility 
> of preemption for a critical region of code. This doesn't stop 
> interrupts as described here: 
> http://www.vxdev.com/docs/vx55man/vxworks/ref/taskLib.html#taskLock 
> <http://www.vxdev.com/docs/vx55man/vxworks/ref/taskLib.html#taskLock>

there is currently no API function for this.

>
> What would be the recommended approach in rtems? Using semaphores 
> would not prevent a higher priority thread from preempting me.

The thread dispatch disable level used internally would provide the 
functionality of taskLock()/taskUnlock(). What is your use case for 
this? Why can't you use a mutex?

The Universal Memory Allocator (UMA) of libbsd disables thread 
dispatching to access the per-processor caches, however, it should be 
quite rare to have such a use case at application level.

-- 
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber at embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.




More information about the users mailing list