B
B
beduin012017-02-26 12:43:19
C++ / C#
beduin01, 2017-02-26 12:43:19

How is reading from the file system done?

I can not understand. Let's say a program needs to read a file. It refers to the OS, the OS calls the driver. Right?
The driver creates a new flow in which reads the data? Does the stream block until the read completes, or is a request sent to the device, and the device itself returns the data to the buffer and knocks to the driver that it has completed processing?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
1
15432, 2017-02-26
@15432

On Windows, the drivers are in the kernel. A new thread is not created, the driver only processes incoming read requests and transfers them to other drivers, for example, usb mass storage or ahci. Which, in turn, interact with USB or ATA host controllers.
The call to ReadFile itself blocks the execution of the program until the operation is completed (but it can also be done asynchronously)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question