'if there are 8 core cpu, theoretically OS can write 8 files at the same time?
If there are 8 core cpu, theoretically OS can write 8 files at the same time with out context switching?
Is there a big difference in speed between writing 8 1gb text files sequentially and at the same time?(using thread or multiprocess)
Solution 1:[1]
Os can open many files and write at a time regardless of the cpu cores but the bottleneck is hard-drive. Even if you have 8 core cpu all of your data that you write have to go sequentially to the hard-drive.
However modern OS don't write directly to files so If you open and write 8 files at same time it is going to stored on RAM and puts in queue for writing to hard-drive so whenever hard-drive gets free it will take that data from ram and write it to the disk.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Vaibhav.c |
