Difference between Asynchronous and Non-blocking ?
Non-blocking means the working thread is not blocked when the code stops, for example when it waits for DB response. It simply moves to treat other requests/tasks.Asynchronous implies some mechanism that puts the code to sleep and wakes it up once something happens, for example when the DB did return something.
In this sense, nonblocking is made possible to the asynchronous mechanism.
You can NOT get nonblocking code without asynchronicity.
You can, however, get asynchronous code which is blocked - the thread can simply block and wait for the response. Actually many webframeworks work this way such as ASP.NET (classic), JSP, etc.
No comments:
Post a Comment