随笔分类 - 多线程多进程
摘要://main.cpp#include #include void worker(){ std::cout << "another thread";}int main(){ std::thread t(worker); std::cout << "main thread" << std::endl; t.join(); return 0;}编译:g++ main.cp...
        阅读全文
                
摘要:一、传递一个参数。 #include #include using namespace std; void* thr_fn(void* arg){ int i = *(int*)arg; cout #include using namespace std; struct parameter{ char a; int i; float f;}; void* thr_fn(void* ar...
        阅读全文
                
摘要:多线程MultiThreading.c #include #include #include #include #define MAX 10 pthread_t thread[2];//线程ID pthread_mutex_t mut;//定义互斥锁变量 int number=0, i; v...
        阅读全文
                
 
                    
                     
                    
                 
                    
                
 
         浙公网安备 33010602011771号
浙公网安备 33010602011771号