I've developed an application that frequently utilizes pread and pwrite for reading and writing to a network devices. The operation typically takes around 7 minutes to complete.
我已经开发了一个应用程序,该应用程序经常使用扩展和写入来读取和写入网络设备。手术通常需要大约7分钟才能完成。
However, when I execute two separate instances of this application concurrently but to two different devices, the completion time extends to 15 minutes. I'm seeking to understand the underlying mechanism behind pread64 and pwrite64 and identify the potential bottleneck.
然而,当我同时在两个不同的设备上执行这个应用程序的两个单独的实例时,完成时间延长到15分钟。我正在努力了解pread64和pWrite64背后的底层机制,并确定潜在的瓶颈。
It's important to note that these two processes are not accessing the same device, and there are no shared resources between them.
重要的是要注意,这两个进程访问的不是同一设备,并且它们之间没有共享资源。
I'm using Linux.
我使用的是Linux。
更多回答
It looks like only one instance of pread is executed at particular moment. You need to see the implementation
看起来在特定时刻只执行了一个扩展实例。您需要查看实现
there are no shared resources between them "a hardware device" is certainly a shared resource.
它们之间没有共享资源“硬件设备”当然是共享资源。
@AndrewHenle not the same device, two different devices
@AndrewHenle不是同一个设备,两个不同的设备
@0___________ is multi processes or multi threaded could solve this issue?
@0_是多进程还是多线程可以解决这个问题?
Please amend your question to say which OS you are using. What are the two devices? How are they connected?
请修改你的问题,说明你使用的是哪种操作系统。这两个设备是什么?它们是如何联系在一起的?
优秀答案推荐
我是一名优秀的程序员,十分优秀!