With asynchronous approach, whole code shares the same process stack and it is kept small by continuous stack unwinding between tasks.Using an asynchronous model means you have less activities going on at the same time so races can be easily avoided. The I/O part of threaded code is comparatively easy but managing the shared state of critical section between threads (using locks/queues/etc) without race conditions is what makes it challenging. In case of multi-threaded program the code needs to be thread safe to control race conditions. With Asynchronous code it is known where the control will shift from one task to another hence race conditions are harder to arrive.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |