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
2fceca73
Commit
2fceca73
authored
3 years ago
by
Florian Fischer
Browse files
Options
Downloads
Patches
Plain Diff
[Runtime] use gettid() if provided by libc
parent
829b9529
No related branches found
Branches containing commit
No related tags found
1 merge request
!238
Consume liburing as meson wrap if native is not recent enough
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
emper/Runtime.cpp
+6
-3
6 additions, 3 deletions
emper/Runtime.cpp
emper/meson.build
+3
-0
3 additions, 0 deletions
emper/meson.build
with
9 additions
and
3 deletions
emper/Runtime.cpp
+
6
−
3
View file @
2fceca73
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
// Non portable.
// Non portable.
#include
<sched.h>
// for cpu_set_t, CPU_SET, CPU_ZERO
#include
<sched.h>
// for cpu_set_t, CPU_SET, CPU_ZERO
#include
<sys/sysinfo.h>
// for get_nprocs
#include
<sys/sysinfo.h>
// for get_nprocs
#include
<unistd.h>
#include
<cstdlib>
// for rand, srand, abort
#include
<cstdlib>
// for rand, srand, abort
#include
<cstring>
#include
<cstring>
...
@@ -48,8 +49,10 @@
...
@@ -48,8 +49,10 @@
#include
<urcu.h>
// for rcu_register_thread
#include
<urcu.h>
// for rcu_register_thread
#endif
#endif
#include
<syscall.h>
// for SYS_gettid
#ifndef EMPER_HAS_GETTID
#include
<unistd.h>
// for syscall
#include
<syscall.h>
#define gettid() (syscall(SYS_gettid))
#endif
std
::
mutex
Runtime
::
currentRuntimeMutex
;
std
::
mutex
Runtime
::
currentRuntimeMutex
;
Runtime
*
Runtime
::
currentRuntime
;
Runtime
*
Runtime
::
currentRuntime
;
...
@@ -249,7 +252,7 @@ auto Runtime::workerLoop(Worker* worker) -> void* {
...
@@ -249,7 +252,7 @@ auto Runtime::workerLoop(Worker* worker) -> void* {
workerIo
->
setWorkerIo
(
worker
);
workerIo
->
setWorkerIo
(
worker
);
}
}
LOGD
(
"Worker loop started by thread "
<<
syscall
(
SYS_
gettid
));
LOGD
(
"Worker loop started by thread "
<<
gettid
(
));
int
oldType
;
int
oldType
;
errno
=
pthread_setcanceltype
(
PTHREAD_CANCEL_ASYNCHRONOUS
,
&
oldType
);
errno
=
pthread_setcanceltype
(
PTHREAD_CANCEL_ASYNCHRONOUS
,
&
oldType
);
...
...
This diff is collapsed.
Click to expand it.
emper/meson.build
+
3
−
0
View file @
2fceca73
cpp_has_gettid
=
cpp_compiler
.
has_function
(
'gettid'
,
prefix
:
'#include<unistd.h>'
)
conf_data
.
set
(
'EMPER_HAS_GETTID'
,
cpp_has_gettid
)
emper_asm_sources
=
[
'ContextAsm.nasm'
]
emper_asm_sources
=
[
'ContextAsm.nasm'
]
nasm
=
find_program
(
'nasm'
)
nasm
=
find_program
(
'nasm'
)
# mesons's nasm support currently means using generator()
# mesons's nasm support currently means using generator()
...
...
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