对磁盘的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或其他技术…
相关文章:
- 如何检查线程是否锁定
- MESI协议和std::atomic-它是否确保所有写入立即对其他线程可见?
- 在 openmp 中,omp_get_thread_num是否绑定到物理线程?
- 并发/多线程:是否可以以这种方式生成相同的输出?
- 我是否生成线程并导致内存泄漏?
- 虚假唤醒是否会解锁所有等待线程,甚至是不相关的线程?
- 静态 constexpr 类成员变量对多线程读取是否安全?
- 是否可以创建一个从不同类调用函数的线程?
- 是否有必要获取锁并在不需要唤醒线程时通知condition_variable?
- C++:在多个线程中访问同一数组/向量的不同单元格是否会产生数据竞赛?
- 线程调用的函数对对象删除是否安全?
- 在不同的内存位置同时写入 std::d eque 是否线程安全?
- 在 OpenCV 中访问具有多个线程的 Mat 是否线程安全?
- 在 C++20 中获取当前日期/时间是否线程安全?
- 在 c++ 的多个线程中编写 c 数组的不同项是否线程安全
- 当结构数组在主线程中填充数据时,从结构数组的低索引元素读取是否线程安全
- boost套接字读写功能是否线程安全
- 对磁盘的openmp写入是否线程安全
- 测试静态局部对象的初始化是否线程安全
- Boost ptime是否线程安全