Skip to content

Google Summer of Code: 2023

Vinícius dos Santos Oliveira edited this page Feb 23, 2023 · 12 revisions

For a general overview of Google Summer of Code (GSoC) and Boost's related activities, please read GSoC Overview

Suggested GSoC project proposals

Boost.Asio: random_access_file support in FreeBSD/kqueue

Potential mentor: Vinícius Oliveira

Requirements

  • Solid knowledge on basic C++
  • Experience with some event-oriented IO framework (e.g. select(), epoll(), kqueue, IOCP)
  • Basic experience with C++ templates
  • It isn't afraid to spend a whole day reading manpages

Background

Boost.Asio is a proactor framework for networking programming that abstracts the differences among the different operating systems. Boost.Asio 1.78 added support for file operations through completion ports on Windows, and io_uring on Linux. Platforms that make use of the kqueue backend (e.g. FreeBSD) currently lack support for file IO.

Kqueue can be configured to receive IO completion events for operations initiated by POSIX AIO (aio_read() + SIGEV_KEVENT). Boost.Asio kqueue backend (<asio/detail/impl/kqueue_reactor.ipp>) must be modified to make use of this support. asio::stream_file need NOT to be supported as POSIX AIO requests always expect an offset.

Competency test

  1. Write a C program that copies the contents of a source file to a destination file. The program must use a buffer of just 1024 bytes. Input files may be larger than 1024 bytes. POSIX AIO must be used to perform read and write operations. Kqueue must be used to consume notification of IO completion events.
  2. Implement a Boost.Asio service that uses kqueue in a separate thread to handle UNIX signals and post the results to the main asio::io_context thread.

Boost.Asio: Expose a lower-level API to interact with io_uring's queues

Potential mentor: Vinícius Oliveira

Requirements

  • 2 years of experience with C++
  • A little bit of templates (you should at least understand type traits, and partial template specialization).
  • Experience with threads

Background

Currently Boost.Asio offers support to interact directly with some OS primitives. The support for interacting directly with the io_uring queue is non-existent as of right now. This gap means Boost.Asio programs are unable to make use of many of io_uring's functions (e.g. io_uring_prep_fsync() and io_uring_prep_splice() to name a few).

This project will expose an io_uring-specific API in Boost.Asio so programs can register their own io_uring-based operations against Boost.Asio's execution context.

Competency test

  1. Implement sleep-sort using io_uring.
  2. Implement sleep-sort using Boost.Asio.
  3. Write a little text explaining the program flow for Boost.Asio to schedule an operation against an io_uring queue and to consume the result back. Hint: grep for io_uring_cqe_get_data() and that should give you the point where Boost.Asio demuxes and dispatches the result of the operations that it scheduled. Walk your way from there and document your findings.
Clone this wiki locally