Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
FORMUS3IC_LAS3
/
embb
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
a0d83966
authored
Apr 13, 2015
by
Tobias Fuchs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
containers_cpp: added assertions and comments in WaitFreeMPMCQueue
parent
3fe8c475
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
57 additions
and
68 deletions
+57
-68
containers_cpp/include/embb/containers/internal/wait_free_mpmc_queue-inl.h
+52
-61
containers_cpp/include/embb/containers/wait_free_mpmc_queue.h
+2
-2
containers_cpp/test/main.cc
+2
-4
containers_cpp/test/queue_test-inl.h
+1
-1
No files found.
containers_cpp/include/embb/containers/internal/wait_free_mpmc_queue-inl.h
View file @
a0d83966
This diff is collapsed.
Click to expand it.
containers_cpp/include/embb/containers/wait_free_mpmc_queue.h
View file @
a0d83966
...
...
@@ -176,7 +176,7 @@ class WaitFreeMPMCQueue {
* OperationDesc::NodeIndex (15 bit) minus one element
* required for sentinel node.
*/
static
const
index_t
QUEUE_SIZE_MAX
=
static_cast
<
index_t
>
(
32767
-
1
);
static
const
index_t
QUEUE_SIZE_MAX
=
static_cast
<
index_t
>
(
0x3FFFFFFF
-
1
);
/**
* Number of guards per thread
...
...
@@ -186,7 +186,7 @@ class WaitFreeMPMCQueue {
/**
* Null-pointer for hazard pointers
*/
static
const
index_t
UndefinedGuard
=
0
;
static
const
index_t
UndefinedGuard
=
0
x3fffffff
;
/**
* Helper class for operation descriptions.
...
...
containers_cpp/test/main.cc
View file @
a0d83966
...
...
@@ -62,20 +62,18 @@ PT_MAIN("Data Structures C++") {
unsigned
int
max_threads
=
static_cast
<
unsigned
int
>
(
2
*
partest
::
TestSuite
::
GetDefaultNumThreads
());
embb_thread_set_max_count
(
max_threads
);
#if 0
PT_RUN
(
PoolTest
<
WaitFreeArrayValuePool
<
int
COMMA
-
1
>
>
);
PT_RUN
(
PoolTest
<
LockFreeTreeValuePool
<
int
COMMA
-
1
>
>
);
PT_RUN
(
HazardPointerTest
);
PT_RUN
(
QueueTest
<
WaitFreeSPSCQueue
<
::
std
::
pair
<
size_t
COMMA
int
>
>
>
);
PT_RUN
(
QueueTest
<
LockFreeMPMCQueue
<
::
std
::
pair
<
size_t
COMMA
int
>
>
COMMA
true
COMMA
true
>
);
#endif
PT_RUN
(
QueueTest
<
WaitFreeMPMCQueue
<
::
std
::
pair
<
size_t
COMMA
int
>
>
COMMA
true
COMMA
true
>
);
#if 0
PT_RUN
(
StackTest
<
LockFreeStack
<
int
>
>
);
PT_RUN
(
ObjectPoolTest
<
LockFreeTreeValuePool
<
bool
COMMA
false
>
>
);
PT_RUN
(
ObjectPoolTest
<
WaitFreeArrayValuePool
<
bool
COMMA
false
>
>
);
#endif
PT_EXPECT_EQ
(
embb_get_bytes_allocated
(),
static_cast
<
size_t
>
(
0
));
}
containers_cpp/test/queue_test-inl.h
View file @
a0d83966
...
...
@@ -125,7 +125,7 @@ QueueTestOrderMPMC_Post() {
for
(
size_t
t
=
0
;
t
<
static_cast
<
size_t
>
(
n_producers
*
n_producer_elements
/
8
);
++
t
)
{
PT_ASSERT_EQ_MSG
(
total_tally
[
t
]
,
0xff
,
PT_ASSERT_EQ_MSG
(
static_cast
<
int
>
(
total_tally
[
t
])
,
0xff
,
"missing dequeued elements"
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment