luminousmen / luminousmen.com

2 stars 0 forks source link

https://luminousmen.com/post/asynchronous-programming-blocking-and-non-blocking #28

Closed utterances-bot closed 1 month ago

utterances-bot commented 3 years ago

Asynchronous programming. Blocking I/O and non-blocking I/O - Blog | luminousmen

In this post, we will be talking about networking blocking and non-blocking I/O in order to explain the concept of asynchronous programming

https://luminousmen.com/post/asynchronous-programming-blocking-and-non-blocking

rohithill commented 3 years ago

In first example of client.py:

    with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sock:
        while True: # This line is not required
            sock.connect((host, port))
code-hard-play-harder commented 3 years ago

Is "non-blocking but the still synchronous approach is called I/O multiplexing" conflicted with your first diagram?

luminousmen commented 3 years ago

@pengbomuzzy You're right - the diagram is not correct. I/O multiplexing is a blocking approach. But it allows blocking on multiple resources simultaneously, without needing to use polling or multithreading.