Skip to content

dyoshimitsu/mpmt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mpmt

Multi-process and multi-thread sample program

Compile

$ make all
clang -O2 ./multi_process/multi_process_sample.c -o multi_process_sample.out
clang -O2 ./multi_process/multi_process_benchmark.c -o multi_process_benchmark.out
clang -O2 ./multi_thread/multi_thread_sample.c -o multi_thread_sample.out
clang -O2 ./multi_thread/multi_thread_benchmark.c -o multi_thread_benchmark.out

Execute

Share memory

Multi-process

$ ./multi_process_sample.out
parent n[0x7ffee36e2954]=1
child  n[0x7ffee36e2954]=1
child  n[0x7ffee36e2954]=2
parent n[0x7ffee36e2954]=2

Multi-thread

$ ./multi_thread_sample.out
main n[0x7ffee483e964]=1
sub  n[0x7ffee483e964]=1
sub  n[0x7ffee483e964]=2
main n[0x7ffee483e964]=3

Benchmark

Multi-process

$ ./multi_process_benchmark.out
....................................................................................................
processing time : 19081[µs]

Multi-thread

$ ./multi_thread_benchmark.out
....................................................................................................
processing time : 8389[µs]

Limit

Multi-process

$ ./multi_process_challenge.out
.........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
generated processes : 1193

Multi-thread

$ ./multi_thread_challenge.out
...............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
generated threads : 4095

About

Multi-process and multi-thread sample program

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published