Does Linux Time Division Processes Or Threads
问题 A prof once told us in class that Windows, Linux, OS X and UNIX scale on threads and not processes, so threads would likely benefit your application even on a single processor because your application would be getting more time on the CPU. I tried with the following code on my machine (which only has one CPU). #include <stdio.h> #include <stdlib.h> #include <pthread.h> pthread_t xs[10]; void *nop(void *ptr) { unsigned long n = 1UL << 30UL; while(n--); return NULL; } void test_one() { size_t