openmp写入磁盘线程安全吗?
Is openmp writing to the disk thread safe?
我的 C++ 程序伪代码如下所示:
#omp pragma parallel
for (i=1...100000)
write input files into a file called "$i.txt", $i is the value of i
then do ./outside_program $i.txt and reads its inputs and do other stuff
假设 ./outside_program
是线程安全的。使用 openmp
写入 C++
线程安全的不同文件吗?
如果您正在写入不同的文件,我认为没问题,它是线程安全的。
这个问题实际上与您使用的多线程 API 无关。 OpenMP、TBB 或其他技术...
我的 C++ 程序伪代码如下所示:
#omp pragma parallel
for (i=1...100000)
write input files into a file called "$i.txt", $i is the value of i
then do ./outside_program $i.txt and reads its inputs and do other stuff
假设 ./outside_program
是线程安全的。使用 openmp
写入 C++
线程安全的不同文件吗?
如果您正在写入不同的文件,我认为没问题,它是线程安全的。 这个问题实际上与您使用的多线程 API 无关。 OpenMP、TBB 或其他技术...