Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
typon
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tom Niget
typon
Commits
ebf375d2
Commit
ebf375d2
authored
Jun 30, 2022
by
Xavier Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename _stealables into _potential
parent
89b06540
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
10 deletions
+10
-10
rt/include/typon/core/scheduler.hpp
rt/include/typon/core/scheduler.hpp
+5
-5
rt/include/typon/core/worker.hpp
rt/include/typon/core/worker.hpp
+5
-5
No files found.
rt/include/typon/core/scheduler.hpp
View file @
ebf375d2
...
...
@@ -39,7 +39,7 @@ namespace typon
{
uint
id
=
fdt
::
random
::
random
()
%
get
().
_concurrency
;
get
().
_worker
[
id
].
add
(
new
Stack
(
task
));
get
().
_
stealables
.
fetch_add
(
1
);
get
().
_
potential
.
fetch_add
(
1
);
get
().
_notifyer
.
notify_one
();
}
...
...
@@ -69,13 +69,13 @@ namespace typon
{
uint
id
=
fdt
::
random
::
random
()
%
get
().
_concurrency
;
get
().
_worker
[
id
].
add
(
stack
);
get
().
_
stealables
.
fetch_add
(
1
);
get
().
_
potential
.
fetch_add
(
1
);
}
get
().
_notifyer
.
notify_one
();
}
std
::
atomic
<
uint
>
_thieves
=
0
;
std
::
atomic
<
u64
>
_
stealables
=
0
;
std
::
atomic
<
u64
>
_
potential
=
0
;
std
::
vector
<
Worker
>
_worker
;
std
::
vector
<
std
::
thread
>
_thread
;
std
::
atomic_bool
_done
{
false
};
...
...
@@ -91,7 +91,7 @@ namespace typon
for
(
uint
i
=
0
;
i
<
concurrency
;
i
++
)
{
_worker
[
i
].
_gc
=
&
(
_gc
);
_worker
[
i
].
_
stealables
=
&
(
_stealables
);
_worker
[
i
].
_
potential
=
&
(
_potential
);
}
thread_id
=
concurrency
;
...
...
@@ -168,7 +168,7 @@ namespace typon
}
if
(
_thieves
.
fetch_sub
(
1
)
==
1
)
{
if
(
_
stealables
.
load
()
>
0
)
if
(
_
potential
.
load
()
>
0
)
{
_notifyer
.
cancel_wait
();
continue
;
...
...
rt/include/typon/core/worker.hpp
View file @
ebf375d2
...
...
@@ -47,7 +47,7 @@ namespace typon
std
::
mutex
_mutex
;
std
::
atomic
<
Stack
*>
_stack
{
nullptr
};
std
::
vector
<
Stack
*>
_pool
;
std
::
atomic_uint_fast64_t
*
_
stealables
;
std
::
atomic_uint_fast64_t
*
_
potential
;
fdt
::
lock_free
::
garbage_collector
*
_gc
;
~
Worker
()
...
...
@@ -97,7 +97,7 @@ namespace typon
{
_gc
->
retire
(
stack
);
}
_
stealables
->
fetch_add
(
1
);
_
potential
->
fetch_add
(
1
);
work
.
_stack
->
resume
();
}
else
...
...
@@ -106,12 +106,12 @@ namespace typon
{
_stack
.
store
(
new
Stack
());
}
_
stealables
->
fetch_add
(
1
);
_
potential
->
fetch_add
(
1
);
work
.
_task
.
resume
();
}
if
(
_stack
.
load
())
{
_
stealables
->
fetch_sub
(
1
);
_
potential
->
fetch_sub
(
1
);
}
}
...
...
@@ -184,7 +184,7 @@ namespace typon
{
return
stack
;
}
_
stealables
->
fetch_sub
(
1
);
_
potential
->
fetch_sub
(
1
);
return
{};
}
};
...
...
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