mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-10-04 21:51:02 +00:00
Improve multithreading
This commit is contained in:
parent
d3167126aa
commit
30afd6ddbb
38 changed files with 752 additions and 174 deletions
|
@ -34,6 +34,7 @@
|
|||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/runtime/stack.h"
|
||||
#include "libc/runtime/sysconf.h"
|
||||
#include "libc/stdio/rand.h"
|
||||
#include "libc/sysv/consts/prot.h"
|
||||
#include "libc/sysv/consts/sa.h"
|
||||
#include "libc/sysv/consts/sched.h"
|
||||
|
@ -279,11 +280,10 @@ static void CreateDetached(void) {
|
|||
ASSERT_EQ(0, pthread_attr_destroy(&attr));
|
||||
}
|
||||
|
||||
BENCH(pthread_create, bench) {
|
||||
TEST(pthread_create, bench) {
|
||||
EZBENCH2("CreateJoin", donothing, CreateJoin());
|
||||
EZBENCH2("CreateDetach", donothing, CreateDetach());
|
||||
EZBENCH2("CreateDetached", donothing, CreateDetached());
|
||||
while (!pthread_orphan_np()) {
|
||||
_pthread_decimate();
|
||||
}
|
||||
while (!pthread_orphan_np())
|
||||
pthread_decimate_np();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue