Skip to content
clarus edited this page Sep 26, 2014 · 23 revisions

It seems hard and even impossible to have fully asynchronous system API on widespread operating systems such as Linux. Asynchronous calls can be emulated using one thread per call, but threads are expensive.

Waiting for this problem to be properly solved, we will design an asynchronous and OS independent API, interacting with the OS through a proxy. The proxy communicates with the application using a pipe, and tries to be as less blocking as possible.

Simple API

We describe here a simple API which will be used to start with. There is no error handling, and read/write operations are of unbounded size.

Output messages

  • Log.write message
  • File.read file_name
  • System.exit
  • TCPClientSocket.write id message
  • TCPClientSocket.close id
  • TCPServerSocket.bind port
  • TCPServerSocket.close id

Input messages

  • File.read file_name content
  • TCPClientSocket.accepted id
  • TCPClientSocket.read id counter content
  • TCPClientSocket.written id
  • TCPServerSocket.bound id

References

Clone this wiki locally