[PATCH 4/6] score: Decouple thread and scheduler nodes on SMP
Gedare Bloom
gedare at rtems.org
Fri Jun 13 17:27:26 UTC 2014
>>> /*
>>> * This is done when we need to check if reevaluations are needed.
>>> */
>>> if ( victim == NULL ) {
>>> - return _Scheduler_priority_Ready_queue_first(
>>> + node = (Scheduler_priority_affinity_SMP_Node *)
>>> + _Scheduler_priority_Ready_queue_first(
>>> &self->Bit_map,
>>> &self->Ready[ 0 ]
>>> );
>>> +
>>> + return &node->Base.Base.Base;
>>
>> This Base.Base.Base is quite awkward and not at all clear what it
>> means. Shouldn't this be using a downcast() function? Repeated a few
>> times.
>>
>> -Gedare
>
>
> No, this Base.Base.Base basically is an upcast. In C++ this stuff would be
> hidden the compiler for you, but we use C, so object oriented stuff is
> awkward.
>
Got it, but it might improve readability to introduce something like
_Scheduler_priority_affinity_SMP_Node_upcast_to_scheduler_node()
-Gedare
More information about the devel
mailing list