3 #ifndef __CDS_OS_DETAILS_FAKE_TOPOLOGY_H
4 #define __CDS_OS_DETAILS_FAKE_TOPOLOGY_H
6 #include <cds/details/defs.h>
7 #include <cds/threading/model.h>
10 namespace cds { namespace OS { namespace details {
12 /// Fake system topology
13 struct fake_topology {
14 /// Logical processor count for the system
15 static unsigned int processor_count()
20 /// Get current processor number
22 The function emulates "current processor number" using thread-specific data.
24 static unsigned int current_processor()
26 // Use fake "current processor number" assigned for current thread
27 return (unsigned int) threading::Manager::fake_current_processor();
30 /// Synonym for \ref current_processor
31 static unsigned int native_current_processor()
33 return current_processor();
36 }}} // namespace cds::OS::details
39 #endif // #ifndef __CDS_OS_DETAILS_FAKE_TOPOLOGY_H