Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
emper
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lehrstuhl für Informatik 4 (Systemsoftware)
manycore
emper
Commits
65880e12
Commit
65880e12
authored
3 years ago
by
Florian Schmaus
Browse files
Options
Downloads
Patches
Plain Diff
Move all definitions from emper.hpp in compilation unit
parent
2cae4faf
No related branches found
No related tags found
1 merge request
!232
Move all definitions from emper.hpp in compilation unit
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
emper/Emper.cpp
+35
-0
35 additions, 0 deletions
emper/Emper.cpp
emper/include/emper.hpp
+6
-25
6 additions, 25 deletions
emper/include/emper.hpp
with
41 additions
and
25 deletions
emper/Emper.cpp
+
35
−
0
View file @
65880e12
...
...
@@ -2,16 +2,46 @@
// Copyright © 2020-2021 Florian Schmaus
#include
"Emper.hpp"
#include
<cassert>
#include
<cerrno>
#include
<cstdint>
#include
<stdexcept>
#include
<utility>
#include
"Common.hpp"
#include
"Fiber.hpp"
#include
"Runtime.hpp"
#include
"emper-common.h"
#include
"emper-version.h"
#include
"emper.hpp"
#include
"io/Future.hpp"
void
async
(
Fiber
*
fiber
)
{
assert
(
fiber
!=
nullptr
);
Runtime
*
runtime
=
Runtime
::
getRuntime
();
runtime
->
schedule
(
*
fiber
);
}
void
async
(
Fiber
::
fiber_fun_t
function
,
void
*
arg
)
{
Fiber
*
fiber
=
Fiber
::
from
(
std
::
move
(
function
),
arg
);
async
(
fiber
);
}
void
async
(
const
Fiber
::
fiber_fun0_t
&
function
)
{
Fiber
*
fiber
=
Fiber
::
from
(
function
);
async
(
fiber
);
}
void
async
(
Fiber
::
fiber_fun_t
function
,
void
*
arg
,
workeraffinity_t
*
affinity
)
{
Fiber
*
fiber
=
Fiber
::
from
(
std
::
move
(
function
),
arg
,
affinity
);
async
(
fiber
);
}
void
async
(
const
Fiber
::
fiber_fun0_t
&
function
,
workeraffinity_t
*
affinity
)
{
Fiber
*
fiber
=
Fiber
::
from
(
function
,
affinity
);
async
(
fiber
);
}
namespace
emper
{
auto
getFullVersion
()
->
std
::
string
{
return
EMPER_FULL_VERSION
;
}
...
...
@@ -48,6 +78,11 @@ void destroy_runtime() {
delete
runtime
;
}
void
yield
()
{
Runtime
*
runtime
=
Runtime
::
getRuntime
();
runtime
->
yield
();
}
auto
sleep
(
unsigned
int
seconds
)
->
bool
{
if
constexpr
(
!
emper
::
IO
)
{
DIE_MSG
(
"sleep requires emper::io"
);
...
...
This diff is collapsed.
Click to expand it.
emper/include/emper.hpp
+
6
−
25
View file @
65880e12
...
...
@@ -11,31 +11,15 @@
#include
"Runtime.hpp"
#include
"SynchronizedFiber.hpp"
void
async
(
Fiber
*
fiber
)
{
assert
(
fiber
!=
nullptr
);
Runtime
*
runtime
=
Runtime
::
getRuntime
();
runtime
->
schedule
(
*
fiber
);
}
void
async
(
Fiber
*
fiber
);
void
async
(
Fiber
::
fiber_fun_t
function
,
void
*
arg
)
{
Fiber
*
fiber
=
Fiber
::
from
(
std
::
move
(
function
),
arg
);
async
(
fiber
);
}
void
async
(
Fiber
::
fiber_fun_t
function
,
void
*
arg
);
void
async
(
const
Fiber
::
fiber_fun0_t
&
function
)
{
Fiber
*
fiber
=
Fiber
::
from
(
function
);
async
(
fiber
);
}
void
async
(
const
Fiber
::
fiber_fun0_t
&
function
);
void
async
(
Fiber
::
fiber_fun_t
function
,
void
*
arg
,
workeraffinity_t
*
affinity
)
{
Fiber
*
fiber
=
Fiber
::
from
(
std
::
move
(
function
),
arg
,
affinity
);
async
(
fiber
);
}
void
async
(
Fiber
::
fiber_fun_t
function
,
void
*
arg
,
workeraffinity_t
*
affinity
);
void
async
(
const
Fiber
::
fiber_fun0_t
&
function
,
workeraffinity_t
*
affinity
)
{
Fiber
*
fiber
=
Fiber
::
from
(
function
,
affinity
);
async
(
fiber
);
}
void
async
(
const
Fiber
::
fiber_fun0_t
&
function
,
workeraffinity_t
*
affinity
);
template
<
typename
S
>
void
spawn
(
Fiber
::
fiber_fun_t
function
,
void
*
arg
,
S
&
semaphore
)
{
...
...
@@ -69,10 +53,7 @@ void init_runtime(workerid_t worker_count);
void
destroy_runtime
();
void
yield
()
{
Runtime
*
runtime
=
Runtime
::
getRuntime
();
runtime
->
yield
();
}
void
yield
();
auto
sleep
(
unsigned
int
seconds
)
->
bool
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment