diff options
author | Dmitry Kozlov <xeb@mail.ru> | 2017-10-12 17:09:41 +0300 |
---|---|---|
committer | Dmitry Kozlov <xeb@mail.ru> | 2017-10-12 18:47:12 +0300 |
commit | ae48a9d61cafaee49fd1936e83e0e919dec5fa2d (patch) | |
tree | b74f3f250c35c799047647f2a62d4dd401a99120 /accel-pppd/triton/triton.h | |
parent | 7be5b657cd57f61971680087e606f36e36605144 (diff) | |
download | accel-ppp-ae48a9d61cafaee49fd1936e83e0e919dec5fa2d.tar.gz accel-ppp-ae48a9d61cafaee49fd1936e83e0e919dec5fa2d.zip |
triton: rewrited context sleeping implementation
Instead of entering working thread into sleep triton saves machine context and stack on sleep and restores context/stack on wakeup.
This saves costly new thread allocation.
Diffstat (limited to 'accel-pppd/triton/triton.h')
-rw-r--r-- | accel-pppd/triton/triton.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/accel-pppd/triton/triton.h b/accel-pppd/triton/triton.h index b66737cf..79bbee1b 100644 --- a/accel-pppd/triton/triton.h +++ b/accel-pppd/triton/triton.h @@ -138,6 +138,8 @@ void triton_terminate(void); #define __export __attribute__((visibility("default"))) #define __unused __attribute__((unused)) +#define barrier() asm volatile ("" ::: "memory") + #undef offsetof #ifdef __compiler_offsetof #define offsetof(TYPE,MEMBER) __compiler_offsetof(TYPE,MEMBER) |