Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
las3_pub
/
predictable_parallel_patterns
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
51667d5c
authored
Feb 04, 2021
by
FritzFlorian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix top-pointer help (potentially not lock free without the fix).
parent
6a123b3b
Pipeline
#2633
passed with stages
in 4 minutes 37 seconds
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
lib/pls/include/pls/internal/scheduling/lock_free/traded_cas_field.h
+3
-2
lib/pls/src/internal/scheduling/lock_free/external_trading_deque.cpp
+2
-1
No files found.
lib/pls/include/pls/internal/scheduling/lock_free/traded_cas_field.h
View file @
51667d5c
...
...
@@ -46,8 +46,6 @@ struct traded_cas_field {
return
stamp_
;
}
[[
nodiscard
]]
unsigned
long
get_trade_request_thread_id
()
const
{
PLS_ASSERT
(
is_filled_with_trade_request
()
||
is_filled_with_object
(),
"Must only read out the tag when the traded field contains one."
);
return
trade_request_thread_id_
-
1
;
}
...
...
@@ -62,6 +60,9 @@ struct traded_cas_field {
[[
nodiscard
]]
bool
is_filled_with_object
()
const
{
return
non_empty_flag_
&&
traded_task_id_
;
}
[[
nodiscard
]]
bool
object_was_traded_in
()
const
{
return
traded_task_id_
!=
0
;
}
[[
nodiscard
]]
bool
is_empty
()
const
{
return
!
non_empty_flag_
;
}
...
...
lib/pls/src/internal/scheduling/lock_free/external_trading_deque.cpp
View file @
51667d5c
...
...
@@ -135,7 +135,8 @@ task *external_trading_deque::pop_top(task *offered_task, peek_result peek_resul
std
::
memory_order_acq_rel
);
return
result
;
}
else
{
if
(
expected_sync_cas_field
.
is_filled_with_object
()
&&
expected_sync_cas_field
.
get_stamp
()
==
expected_top
.
stamp_
if
(
expected_sync_cas_field
.
object_was_traded_in
()
&&
expected_sync_cas_field
.
get_stamp
()
==
expected_top
.
stamp_
&&
expected_sync_cas_field
.
get_trade_request_thread_id
()
==
thread_id_
)
{
top_
.
compare_exchange_strong
(
expected_top
,
{
expected_top
.
stamp_
+
1
,
expected_top
.
value_
+
1
},
...
...
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