Record shared read permits against a fixed pool and report the access mode.

Reader Pool Coordination Report

ReaderPoolCoordinationReport.cs
using System;
using System.Threading;

class Program
{
    static void Main()
    {
        int readers = ;
        int slots = 3;
        var pool = new SemaphoreSlim(slots, slots);
        int held = 0;

        for (int i = 0; i < readers; i++)
        {
            if (pool.Wait(0))
            {
                held++;
            }
        }

        int free = pool.CurrentCount;

        string status;
        if (held == 0)
        {
            status = "writable";
        }
        else if (held == slots)
        {
            status = "shared";
        }
        else
        {
            status = "single";
        }

        Console.WriteLine("readers=" + readers + " held=" + held + " free=" + free + " " + status);
    }
}
using System;
using System.Threading;

class Program
{
    static void Main()
    {
        int readers = ;
        int slots = 3;
        var pool = new SemaphoreSlim(slots, slots);
        int held = 0;

        for (int i = 0; i < readers; i++)
        {
            if (pool.Wait(0))
            {
                held++;
            }
        }

        int free = pool.CurrentCount;

        string status;
        if (held == 0)
        {
            status = "writable";
        }
        else if (held == slots)
        {
            status = "shared";
        }
        else
        {
            status = "single";
        }

        Console.WriteLine("readers=" + readers + " held=" + held + " free=" + free + " " + status);
    }
}
using System;
using System.Threading;

class Program
{
    static void Main()
    {
        int readers = ;
        int slots = 3;
        var pool = new SemaphoreSlim(slots, slots);
        int held = 0;

        for (int i = 0; i < readers; i++)
        {
            if (pool.Wait(0))
            {
                held++;
            }
        }

        int free = pool.CurrentCount;

        string status;
        if (held == 0)
        {
            status = "writable";
        }
        else if (held == slots)
        {
            status = "shared";
        }
        else
        {
            status = "single";
        }

        Console.WriteLine("readers=" + readers + " held=" + held + " free=" + free + " " + status);
    }
}
shared permits A coordination report can record how a shared pool is occupied. A `SemaphoreSlim` created with several permits models a pool of shared read slots, and `Wait(0)` takes one slot without blocking. With no slots taken the pool is writable for an exclusive writer, with one slot taken access is single, and with every slot taken access is fully shared. The status line summarizes whether the pool stayed writable, single, or shared after the recorded read attempts.