Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Current »

Modern computers CPU’s are astoundingly fast. They can perform super large amounts of operations in a fraction of a second.

What is slow is input output operations - I/O operations in jargon. By this we mean:

  • Reading/Writing files to disk

  • Waiting for network operations to complete etc.

Calls to the operating system which perform input/output operations can either be:

  • Blocking - which means that the thread of execution pauses until the I/O operation completes.

  • Non-blocking - which means that the call returns instantly - but we pass in a pointer to a function which will be called back when the call returns. We also call this asynchronous I/O.

Using blocking I/O calls can work fine if you are on a single thread which does not have an event loop on it. If you are using an event loop though then one should either be using non blocking asynchronous I/O or fire off threads which do blocking I/O.

  • No labels