IMPORTANT: This project was completed by Matt Thomas. You may still contact the people above for details, but please do not submit an application for this project.

This project proposal is a subtask of smp networking and is elegible for funding independently.

The goal of this project is to implement lockess and atomic producer/consumer queues (PCQs) in the kernel. A PCQ allows multiple writers (producers) but only a single reader (consumer). Compare-And-Store operations are used to allow lockless updates. The consumer is expected to be protected by a mutex that covers the structure that the PCQ is embedded into (e.g. socket lock, ifnet hwlock). These queues operate in a First-In, First-Out (FIFO) manner. The act of inserting or removing an item from a PCQ does not modify the item in any way. A PCQ does not prevent an item being inserted multiple times into a single PCQ.

Since this structure is not specific to networking it has to be accessed via <sys/pcq.h> and the code has to live in kern/subr_pcq.c.

The proposed interface looks like this:

Add a comment