I studied a lot of multithreading, callback, send queue, synchronously and asynchronously ... The more I do the research, the more embarrassed and frustrated I am to the extent that I feel like I can’t understand what it is. Please someone can lead me in the right direction to start ... the information that I have found so far has been related to what is and what is connected with it. What I really want to know is that the function returns immediately on an asynchronous callback and in the same thread. [here] ( http://nathansjslessons.appspot.com/lesson?id=1085 ) that I received this information from
The function **returns immediately** before the file is read and schedules the read to happen
sometime in the future. Once the data is ready, the callback function is called on the
data.
Here is an example of how to use the regular lock read function to get the contents of a file var readFile = function () {
var data;
data = read('file.txt');
dosomething('contect' + data);
}
The same example uses the asynchronous readAsync function.
var readFileAsynch = function () {
var func = function (x) {
dosomthing('content'+data);
}
**readAsynch('file.txt',func);**
dosomemorestuff();
};
from what I know, if you use a different thread than the main thread, than I thought the way to do asynchronous, then if you have only one thread , for example javascript, then how would it work asynchronously.?
And when it comes to send queues in object c, is it right to think that a queue is just an array of pointers to blocks or functions, and the thread is responsible for managing this queue in the application ..?
, , ..
, -, , , , . , - , " "... ..? , ..?
edit: readAsynch ('file.txt', func); , , asynch..? , dosomemorestuff , readAsynch , ( ), readAsynch, .?