is it ok to understand that when "fs.readFile(~) is called in the code below, a thread to read the disk is automatically generated in readFile's inner procedure? And when the assigned job is done, the thread runs the callback function?
- sorry that i'm not good at English and a student studying OS recently.
var fs = require('fs');
console.log(2);
fs.readFile('data.txt', {encoding: 'utf8'}, function(err, data){
console.log(3);
console.log(data);
})
console.log(4);