Skip to content

QRWells/LibUringSharp

Repository files navigation

LibUringSharp

QRWells.LibUringSharp is a low-level, Linux-only C# wrapper over io_uring.

Requirements

  • Linux only
  • Kernel support depends on the operation you submit
  • IORING_SETUP_NO_MMAP requires a recent kernel (Linux 6.5+)

Install

dotnet add package QRWells.LibUringSharp

Basic usage

using QRWells.LibUringSharp;

using var ring = new Ring(4);

if (!ring.TryGetNextSubmission(out var submission))
    throw new InvalidOperationException("No SQE available");

submission.PrepareNop(2026);
ring.Prepared(submission);

ring.Submit();

if (ring.TryGetCompletion(out var completion))
{
    Console.WriteLine($"{completion.UserData}: {completion.Result}");
}

External ring memory

using QRWells.LibUringSharp;

using var memory = RingMemory.Allocate(256);
using var ring = new Ring(256, memory);

Use Ring.GetRequiredMemorySize(...) when you need to plan memory usage up front.

Development

dotnet build LibUringSharp.sln -c Debug
dotnet test test/LibUringSharp.Test/LibUringSharp.Test.csproj -c Debug -f net10.0

License

MIT

About

A C# wrapper for the Linux io_uring API.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages