Difference between pages "r7.1.1:Macro LFDS711 QUEUE UMM SET KEY IN ELEMENT" and "r7.1.1:Function libbenchmark misc pal helper add logical processor node to topology tree"

From liblfds.org
(Difference between pages)
Jump to navigation Jump to search
m (1 revision imported)
 
m (1 revision imported)
 
Line 1: Line 1:
{{DISPLAYTITLE:macro LFDS711_QUEUE_UMM_SET_KEY_IN_ELEMENT}}
{{DISPLAYTITLE:function libbenchmark_misc_pal_helper_new_topology_node}}
==Source Files==
==Source Files==
  └───liblfds711
  └───test_and_benchmark
     └───inc
     └───libbenchmark
         └───liblfds711
         ├───inc
                lfds711_queue_umm.h
        │  └───libbenchmark
        │          libbenchmark_porting_abstraction_layer.h
        └───src
            └───libbenchmark_misc
                    libbenchmark_misc_pal_helpers.c


==Opaque Structures==
==Opaque Structures==
  struct [[r7.1.1:struct lfds711_queue_umm_element|lfds711_queue_umm_element]];
  struct [[r7.1.1:struct libbenchmark_topology_state|libbenchmark_topology_state]];


==Macro==
==Prototype==
  #define LFDS711_QUEUE_UMM_SET_KEY_IN_ELEMENT( queue_umm_element, new_key )
  void libbenchmark_misc_pal_helper_add_logical_processor_node_to_topology_tree( struct libbenchmark_topology_state *ts,
                                                                                lfds711_pal_uint_t logical_processor_number,
                                                                                enum flag windows_processor_group_inuse_flag,
                                                                                lfds711_pal_uint_t windows_processor_group_number );


==Parameters==
==Parameters==
''queue_umm_element''
''struct libbenchmark_topology_state *ts''
: A ''struct lfds711_queue_umm_element'', which is not currently part of a freelist.  Not a pointer to it - the struct itself.
: A pointer a ''struct libbenchmark_topology'' obtained from ''libbenchmark_pal_populate_topology''.


''new_key''
''lfds711_pal_uint_t logical_processor_number''
: A pointer, which will be cast by the macro to a ''void *'', which the key in ''queue_umm_element'' is set to.
: The logical processor number of the logical processor to add to the topology tree pointed to by ''ts''.
 
''enum flag windows_processor_group_inuse_flag''
: An ''enum flag'' which indicates whether or not the ''windows_processor_group_number'' argument contains a valid value (for that field is only meaningful on Windows 7 and greater).
 
''lfds711_pal_uint_t windows_processor_group_number''
: The Windows processor group number of the logical processor to add to the topology tree pointed to by ''ts''.  This value is only meaningful on Windows 7 and greater.  It will only be used if the ''windows_processor_group_inuse_flag'' is set to ''RAISED'', and so if not used, can be set to any value.  Zero is as good a choice as any other.


==Return Value==
==Return Value==
No return value.
No return value.
==Example==


==Notes==
==Notes==
The key in a queue element can only be set when the element is outside of a queue (i.e. has been dequeued, or has yet to be enqueued).  This macro can be called at any time, but if it is used on an element which is present in a queue, all bets are off - all threads on the logical core which does this will see the change, but there is no guarantee any other logical cores will ever see the change.  You were warned.
This helper function is used by ''libbenchmark_pal_populate_topology'' to add a logical processor node to the topology tree.
 
As with all ''liblfds'' macros, the macro operates on the structure itself, not a pointer to it.
 
The key is not used in any way by the queue, and is provided for convenience when moving keys and values between different data structures.
 
==Example==
Coming soon.  No, really!  (Written 29th Dec 2015).


==See Also==
==See Also==
* [[r7.1.1:Queue (unbounded, many producer, many consumer)|Queue (unbounded, many producer, many consumer)]]
* [[r7.1.1:Porting Guide (libbenchmark)|Porting Guide (libbenchmark)]]
* ''[[r7.1.1:macro LFDS711_QUEUE_UMM_GET_KEY_FROM_ELEMENT|LFDS711_QUEUE_UMM_GET_KEY_FROM_ELEMENT]]''
* ''[[r7.1.1:function libbenchmark_pal_populate_topology|libbenchmark_pal_populate_topology]]''

Latest revision as of 20:16, 17 February 2017

Source Files

└───test_and_benchmark
    └───libbenchmark
        ├───inc
        │   └───libbenchmark
        │           libbenchmark_porting_abstraction_layer.h
        └───src
            └───libbenchmark_misc
                    libbenchmark_misc_pal_helpers.c

Opaque Structures

struct libbenchmark_topology_state;

Prototype

void libbenchmark_misc_pal_helper_add_logical_processor_node_to_topology_tree( struct libbenchmark_topology_state *ts,
                                                                               lfds711_pal_uint_t logical_processor_number,
                                                                               enum flag windows_processor_group_inuse_flag,
                                                                               lfds711_pal_uint_t windows_processor_group_number );

Parameters

struct libbenchmark_topology_state *ts

A pointer a struct libbenchmark_topology obtained from libbenchmark_pal_populate_topology.

lfds711_pal_uint_t logical_processor_number

The logical processor number of the logical processor to add to the topology tree pointed to by ts.

enum flag windows_processor_group_inuse_flag

An enum flag which indicates whether or not the windows_processor_group_number argument contains a valid value (for that field is only meaningful on Windows 7 and greater).

lfds711_pal_uint_t windows_processor_group_number

The Windows processor group number of the logical processor to add to the topology tree pointed to by ts. This value is only meaningful on Windows 7 and greater. It will only be used if the windows_processor_group_inuse_flag is set to RAISED, and so if not used, can be set to any value. Zero is as good a choice as any other.

Return Value

No return value.

Example

Notes

This helper function is used by libbenchmark_pal_populate_topology to add a logical processor node to the topology tree.

See Also