我正在Linux上编写多线程程序,希望在线程中创建一个进程,而不结束其他线程。我查看了fork/exec,但是在linux状态的第3p节中的exec手册页中: shall result in all threads being terminated and the new executable
image being loaded
linux手册中对pthread_join的介绍是:The pthread_join() function waits for the thread specified by thread to terminate我很好奇这个句子是否意味着主线程和子线程分别运行,但是当子线程结束时,主线程可以结束。Child1 thread: 1Parent thread</
我有一个源代码库,它适用于两个平台/编译器:
x86_64-8.1.0-posix-seh-rt_v6-rev0Raspberry Windows 10: MinGw: PI 4/ Linux: Raspberry-gcc8.3.0severity_logger_mt<boost::log::v2_mt_nt5::trivial::severity_level>, boost::log::v2_mt_nt5::sources::multi_thread_modelmt_nt53aux14light_rw_mutex11lock
一旦其中一个线程完成,我希望启动一个处理新文件的新线程,而不会阻塞所有线程直到结束时完成的代码。我不知道该怎么编码。pthread_join()阻止代码执行吗?pthread_join(thread1)thread1必须在pthread_join(thread2)执行之前完成吗?所以,如果我把 pthread_join(thread[i])
co