Tervel  1.0.0
A collection of wait-free containers and algorithms.
thread_context.h
Go to the documentation of this file.
1 /*
2 The MIT License (MIT)
3 
4 Copyright (c) 2015 University of Central Florida's Computer Software Engineering
5 Scalable & Secure Systems (CSE - S3) Lab
6 
7 Permission is hereby granted, free of charge, to any person obtaining a copy
8 of this software and associated documentation files (the "Software"), to deal
9 in the Software without restriction, including without limitation the rights
10 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 copies of the Software, and to permit persons to whom the Software is
12 furnished to do so, subject to the following conditions:
13 
14 The above copyright notice and this permission notice shall be included in
15 all copies or substantial portions of the Software.
16 
17 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 THE SOFTWARE.
24 */
25 #ifndef TERVEL_UTIL_THREAD_CONTEXT_H
26 #define TERVEL_UTIL_THREAD_CONTEXT_H
27 
28 #include <stddef.h>
29 #include <stdint.h>
30 
31 #include <tervel/util/util.h>
32 
33 
34 namespace tervel {
35 class Tervel;
36 
37 namespace util {
38 
39 class RecursiveAction;
40 class ProgressAssurance;
41 
42 namespace memory {
43 namespace hp {
44 
45 class ElementList;
46 class HazardPointer;
47 
48 } // namespace hp
49 
50 namespace rc {
51 
52 class DescriptorPool;
53 
54 } // namespace rc
55 
56 } // namespace memory
57 } // namespace util
58 
63  public:
64  explicit ThreadContext(Tervel* tervel);
65 
67 
72 
77 
86 
87 
88 
89 
94  const uint64_t get_thread_id();
98  const uint64_t get_num_threads();
99 
100  private:
101 
106  Tervel * const tervel_;
107  const uint64_t thread_id_;
110 
111  private:
113 };
114 
115 } // namespace tervel
116 #endif // TERVEL_UTIL_THREAD_CONTEXT_H
ThreadContext(Tervel *tervel)
DISALLOW_COPY_AND_ASSIGN(ThreadContext)
Tervel *const tervel_
Tervel provides a link to the shared Tervel object.
Definition: thread_context.h:106
Thread local information.
Definition: thread_context.h:62
util::memory::rc::DescriptorPool *const get_rc_descriptor_pool()
TODO(steven):
Definition: mcas.h:36
const uint64_t get_thread_id()
A unique ID among all active threads.
util::memory::hp::ElementList *const hp_element_list_
Definition: thread_context.h:108
const uint64_t thread_id_
Definition: thread_context.h:107
const uint64_t get_num_threads()
Defines a list of objects which are stored until they are safe to be freed.
Definition: hp_list.h:56
This class represents the progress assurance scheme employed by our library.
Definition: progress_assurance.h:106
Contains shared information that should be accessible by all threads.
Definition: tervel.h:39
Defines a pool of descriptor objects which is used to allocate descriptors and to store them while th...
Definition: descriptor_pool.h:57
util::memory::hp::ElementList *const get_hp_element_list()
util::memory::rc::DescriptorPool *const rc_descriptor_pool_
Definition: thread_context.h:109
util::ProgressAssurance *const get_progress_assurance()
This class is used to maintain the list of hazard pointed objects.
Definition: hazard_pointer.h:56
util::memory::hp::HazardPointer *const get_hazard_pointer()