SMP: ISR disable/enable vs. mutual exclustion

Chris Johns chrisj at rtems.org
Sat Aug 24 02:10:05 UTC 2013


Sebastian Huber wrote:
> I will add the lock to the rtems_chain_control to keep it simple.

Given below I think we will need more.

>
> There is a big problem with the extract operation:
>
> void _Chain_Extract(
> Chain_Node *node
> )
> {
> ISR_Level level;
>
> _ISR_Disable( level );
> _Chain_Extract_unprotected( node );
> _ISR_Enable( level );
> }
>
> Here we don't have access to the corresponding chain control and thus
> the lock object.

Ouch.

> Thus the normal extract operation is not available on SMP. An extract
> variant which needs also the chain control as a parameter must be used.

I think a node may need a back pointer to the chain control that 
contains a lock. I suspect we cannot have a single score chain control 
structure for both protected and unprotected operations and support the 
current extract. I have not looked at all the uses of extract in the 
code so I do not know if the chain control is available and even it is I 
think the node should handle this.

Chris



More information about the devel mailing list