[PATCH 1/4] score: Add Resource Handler
Gedare Bloom
gedare at rtems.org
Mon Jun 2 13:51:29 UTC 2014
On Mon, Jun 2, 2014 at 9:50 AM, Sebastian Huber
<sebastian.huber at embedded-brains.de> wrote:
> On 2014-06-02 15:47, Gedare Bloom wrote:
>>
>> On Mon, Jun 2, 2014 at 4:35 AM, Sebastian Huber
>> <sebastian.huber at embedded-brains.de> wrote:
>>>
>>> >On 2014-05-28 23:48, Gedare Bloom wrote:
>>>>>
>>>>> >>>
>>>>> >>>+/**
>>>>>>
>>>>>> >>> >+ * @brief Returns true if this is the most recent resource of
>>>>>> >>> > the node,
>>>>>> >>> >and
>>>>>> >>> >+ * false otherwise.
>>>>>> >>> >+ *
>>>>>> >>> >+ * Resources are organized in last in first out order (LIFO).
>>>>>> >>> >+ *
>>>>>> >>> >+ * @param[in] node The node containing the resource.
>>>>>> >>> >+ * @param[in] resource The resource in question.
>>>>>> >>> >+ */
>>>>>> >>> >+RTEMS_INLINE_ROUTINE bool
>>>>>> >>> > _Resource_Is_most_recent_resource_of_node(
>>>>>> >>> >+ const Resource_Node *node,
>>>>>> >>> >+ const Resource_Control *resource
>>>>>> >>> >+)
>>>>
>>>> >>
>>>> >>At first this function name confused me when I saw it used. I'm not
>>>> >>sure if a better name exists but it may be worth considering. Also,
>>>> >>this whole Resource handler is a bit odd compared to other data
>>>> >>structures in RTEMS, in that the interface functions take a Node first
>>>> >>and a Control second. Usually the Control comes first.
>>>> >>
>>>> >>
>>>
>>> >
>>> >The first parameter is usually the this object. So for the
>>> >_Resource_Node_*() functions this is a node. The term "recent" implies
>>> >temporal order and thus is well defined. If we use "first", "last",
>>> > "top"
>>> >or whatever then we would have to explicitly specify the order which
>>> > makes
>>> >the name even longer.
>>> >
>>
>> OK. Is _Resource_Is_most_recently_used() ok? This has a clear parallel
>> with well-known language like LRU.
>
>
> What about _Resource_Is_most_recently_obtained()?
>
Yes, that is probably more clear.
-Gedare
>
> --
> 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 devel
mailing list