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
34f6e4f3
authored
Jun 15, 2015
by
Danila Klimenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chromatic_tree: lock-free implementation without rebalancing
parent
e518a31d
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
27 additions
and
7 deletions
+27
-7
containers_cpp/include/embb/containers/internal/hazard_pointer-inl.h
+1
-1
containers_cpp/include/embb/containers/internal/hazard_pointer.h
+1
-1
containers_cpp/include/embb/containers/internal/lock_free_chromatic_tree-inl.h
+0
-0
containers_cpp/include/embb/containers/internal/object_pool-inl.h
+14
-0
containers_cpp/include/embb/containers/lock_free_chromatic_tree.h
+0
-0
containers_cpp/include/embb/containers/object_pool.h
+6
-0
containers_cpp/test/tree_test-inl.h
+5
-5
No files found.
containers_cpp/include/embb/containers/internal/hazard_pointer-inl.h
View file @
34f6e4f3
...
...
@@ -478,7 +478,7 @@ Type& UniqueHazardPointer<Type>::operator*() const {
}
template
<
typename
Type
>
void
UniqueHazardPointer
<
Type
>::
Adopt
Gu
ard
(
const
UniqueHazardPointer
&
other
)
{
void
UniqueHazardPointer
<
Type
>::
Adopt
Haz
ard
(
const
UniqueHazardPointer
&
other
)
{
assert
(
OwnsHazardGuard
());
StoreGuardedPointer
(
other
.
LoadGuardedPointer
());
SetActive
(
other
.
active_
);
...
...
containers_cpp/include/embb/containers/internal/hazard_pointer.h
View file @
34f6e4f3
...
...
@@ -620,7 +620,7 @@ class UniqueHazardPointer {
* \param other Another wrapper those protected pointer is to be protected by
* the calling wrapper
*/
void
Adopt
Gu
ard
(
const
UniqueHazardPointer
&
other
);
void
Adopt
Haz
ard
(
const
UniqueHazardPointer
&
other
);
/**
* Swaps the guard ownership with another wrapper. Swaps not just the
...
...
containers_cpp/include/embb/containers/internal/lock_free_chromatic_tree-inl.h
View file @
34f6e4f3
This diff is collapsed.
Click to expand it.
containers_cpp/include/embb/containers/internal/object_pool-inl.h
View file @
34f6e4f3
...
...
@@ -201,6 +201,20 @@ Type* ObjectPool<Type, ValuePool, ObjectAllocator>::Allocate(
}
template
<
class
Type
,
typename
ValuePool
,
class
ObjectAllocator
>
template
<
typename
Param1
,
typename
Param2
,
typename
Param3
,
typename
Param4
,
typename
Param5
,
typename
Param6
>
Type
*
ObjectPool
<
Type
,
ValuePool
,
ObjectAllocator
>::
Allocate
(
Param1
const
&
param1
,
Param2
const
&
param2
,
Param3
const
&
param3
,
Param4
const
&
param4
,
Param5
const
&
param5
,
Param6
const
&
param6
)
{
Type
*
rawObject
=
AllocateRaw
();
if
(
rawObject
!=
NULL
)
new
(
rawObject
)
Type
(
param1
,
param2
,
param3
,
param4
,
param5
,
param6
);
return
rawObject
;
}
template
<
class
Type
,
typename
ValuePool
,
class
ObjectAllocator
>
ObjectPool
<
Type
,
ValuePool
,
ObjectAllocator
>::~
ObjectPool
()
{
// Deallocate the objects
objectAllocator
.
deallocate
(
objects
,
capacity
);
...
...
containers_cpp/include/embb/containers/lock_free_chromatic_tree.h
View file @
34f6e4f3
This diff is collapsed.
Click to expand it.
containers_cpp/include/embb/containers/object_pool.h
View file @
34f6e4f3
...
...
@@ -185,6 +185,12 @@ class ObjectPool {
Type
*
Allocate
(
Param1
const
&
param1
,
Param2
const
&
param2
,
Param3
const
&
param3
,
Param4
const
&
param4
,
Param5
const
&
param5
);
template
<
typename
Param1
,
typename
Param2
,
typename
Param3
,
typename
Param4
,
typename
Param5
,
typename
Param6
>
Type
*
Allocate
(
Param1
const
&
param1
,
Param2
const
&
param2
,
Param3
const
&
param3
,
Param4
const
&
param4
,
Param5
const
&
param5
,
Param6
const
&
param6
);
#endif
};
}
// namespace containers
...
...
containers_cpp/test/tree_test-inl.h
View file @
34f6e4f3
...
...
@@ -66,11 +66,11 @@ TreeTest<Tree>::TreeTest()
Add
(
&
TreeTest
::
TreeTestConcurrentGet_ReaderMethod
,
this
,
NUM_TEST_THREADS
/
2
,
NUM_ITERATIONS
).
Post
(
&
TreeTest
::
TreeTestConcurrentGet_Post
,
this
);
CreateUnit
(
"TreeTestBalance"
).
Pre
(
&
TreeTest
::
TreeTestBalance_Pre
,
this
).
Add
(
&
TreeTest
::
TreeTestBalance_ThreadMethod
,
this
,
NUM_TEST_THREADS
,
1
).
Post
(
&
TreeTest
::
TreeTestBalance_Post
,
this
);
//
CreateUnit("TreeTestBalance").
//
Pre(&TreeTest::TreeTestBalance_Pre, this).
//
Add(&TreeTest::TreeTestBalance_ThreadMethod, this,
//
NUM_TEST_THREADS, 1).
//
Post(&TreeTest::TreeTestBalance_Post, this);
}
template
<
typename
Tree
>
...
...
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