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
2eb9674a
authored
6 years ago
by
FritzFlorian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add struct for unique task id type.
parent
ea24f5c2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
3 deletions
+14
-3
lib/pls/include/pls/internal/scheduling/abstract_task.h
+14
-3
No files found.
lib/pls/include/pls/internal/scheduling/abstract_task.h
View file @
2eb9674a
...
@@ -10,12 +10,23 @@ namespace pls {
...
@@ -10,12 +10,23 @@ namespace pls {
namespace
internal
{
namespace
internal
{
namespace
scheduling
{
namespace
scheduling
{
class
abstract_task
{
class
abstract_task
{
struct
id
{
uint32_t
id_
;
bool
auto_generated_
;
explicit
id
(
uint32_t
id
,
bool
auto_generated
=
true
)
:
id_
{
id
},
auto_generated_
{
auto_generated
}
{};
bool
operator
==
(
const
abstract_task
::
id
&
other
)
const
{
return
id_
==
other
.
id_
&&
auto_generated_
==
other
.
auto_generated_
;
}
};
int
depth_
;
int
depth_
;
int
unique_id_
;
abstract_task
::
id
unique_id_
;
abstract_task
*
child_task_
;
abstract_task
*
child_task_
;
public
:
public
:
abstract_task
(
int
depth
,
int
unique_id
)
:
abstract_task
(
int
depth
,
abstract_task
::
id
unique_id
)
:
depth_
{
depth
},
depth_
{
depth
},
unique_id_
{
unique_id
},
unique_id_
{
unique_id
},
child_task_
{
nullptr
}
{}
child_task_
{
nullptr
}
{}
...
@@ -25,7 +36,7 @@ namespace pls {
...
@@ -25,7 +36,7 @@ namespace pls {
abstract_task
*
child
()
{
return
child_task_
;
}
abstract_task
*
child
()
{
return
child_task_
;
}
void
set_depth
(
int
depth
)
{
depth_
=
depth
;
}
void
set_depth
(
int
depth
)
{
depth_
=
depth
;
}
int
depth
()
{
return
depth_
;
}
int
depth
()
const
{
return
depth_
;
}
protected
:
protected
:
virtual
bool
internal_stealing
(
abstract_task
*
other_task
)
=
0
;
virtual
bool
internal_stealing
(
abstract_task
*
other_task
)
=
0
;
virtual
bool
split_task
(
base
::
spin_lock
*
lock
)
=
0
;
virtual
bool
split_task
(
base
::
spin_lock
*
lock
)
=
0
;
...
...
This diff is collapsed.
Click to expand it.
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