Stop doing blocking IO

There's a lot of blocking IO happening. This was mostly a hack to get things working, but not idea, since I spawn a new thread for each file/paste.

Assigned to
1 year, 4 days ago
8 months ago
No labels applied.

~whynothugo 1 year, 4 days ago

To make this feasible, need to switch to a proper event loop (e.g.: calloop?).

~whynothugo 1 year, 3 days ago

So far the best approach seems to be:

  • Create a file descriptor with memfd.
  • Encode the png into it, then seal it.
  • Write to the file with sendfile.
  • When pasting, also write to the fd with sendfile.

Need to write an adaptor that wraps sendfile into a Future.

~whynothugo 8 months ago

Writing to files async is not really feasible, so writing to the file will always happen on a separate thread.

Register here or Log in to comment, or comment via email.