Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interpretation of figure 4.3 #75

Open
mananamenos opened this issue Dec 29, 2023 · 0 comments
Open

Interpretation of figure 4.3 #75

mananamenos opened this issue Dec 29, 2023 · 0 comments

Comments

@mananamenos
Copy link

Hi. The figure 4.3 and its explanation is very confusing, at least for me.

  1. When the asynchronous operation of Task 1 is completed, the event loop gives control to it. When Task 1 completes its internal synchronous processing as well, it notifies the Main function.
  1. When the asynchronous operation triggered by Task 2 is complete, the event loop invokes its callback, giving control back to Task 2. At the end of Task 2, the Main function is notified once more. At this point, the Main function knows that both Task 1 and Task 2 are complete, so it can continue its execution or return the results of the operations to another callback.

How does task 2 or task 3 notify the Main function? Once the Main function runs task 1 and task 2 it terminates its execution stack and everything from that point will be called from event loop. Main function cannot be recalled from dead and ... can continue its execution or return the results of the operations to another callback.

So do authors mean with "notify Main function"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant