[EXTERNAL] Re: rtems_semaphore routines on SMP systems

Sebastian Huber sebastian.huber at embedded-brains.de
Mon Sep 27 17:13:16 UTC 2021


Hello Michel,

On 27/09/2021 18:59, Michel, John M wrote:
> Could you clarify what you mean by "concurrent use and deletion of a semaphore object is undefined behaviour on SMP systems".

sorry for being so unclear. What I meant is using the semaphore (obtain 
or release) in one thread and deleting the semaphore at the same time in 
another thread (you need two processors for this). This is not supported 
on SMP systems. It works most of the time, but not always.

> 
> It seems the whole point of semaphores is concurrent use.  Does RTEMS not support two threads running on two different cores both accessing a semaphore?  To me that would mean RTEMS does not support SMP.

Concurrent use (obtain and release) of the semaphore works of course.

The above restriction is not unusual:

https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_mutex_destroy.html

"Attempting to destroy a locked mutex, or a mutex that another thread is 
attempting to lock, or a mutex that is being used in a 
pthread_cond_timedwait() or pthread_cond_wait() call by another thread, 
results in undefined behavior."

This restriction is for performance reasons.

-- 
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.huber at embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/


More information about the users mailing list