Admit readers against a fixed pool capacity and turn the remaining slots into an admit, hold, or shed remediation action.

Reader Pool Remediation Report

ReaderPoolRemediationReport.cs
using System;

class Program
{
    static void Main()
    {
        int readers = ;
        int capacity = 3;
        int admitted = readers;
        if (admitted > capacity)
        {
            admitted = capacity;
        }
        int remaining = capacity - admitted;

        string action;
        if (remaining >= 2)
        {
            action = "admit";
        }
        else if (remaining == 1)
        {
            action = "hold";
        }
        else
        {
            action = "shed";
        }

        Console.WriteLine("readers=" + readers + " admitted=" + admitted + " remaining=" + remaining + " " + action);
    }
}
using System;

class Program
{
    static void Main()
    {
        int readers = ;
        int capacity = 3;
        int admitted = readers;
        if (admitted > capacity)
        {
            admitted = capacity;
        }
        int remaining = capacity - admitted;

        string action;
        if (remaining >= 2)
        {
            action = "admit";
        }
        else if (remaining == 1)
        {
            action = "hold";
        }
        else
        {
            action = "shed";
        }

        Console.WriteLine("readers=" + readers + " admitted=" + admitted + " remaining=" + remaining + " " + action);
    }
}
using System;

class Program
{
    static void Main()
    {
        int readers = ;
        int capacity = 3;
        int admitted = readers;
        if (admitted > capacity)
        {
            admitted = capacity;
        }
        int remaining = capacity - admitted;

        string action;
        if (remaining >= 2)
        {
            action = "admit";
        }
        else if (remaining == 1)
        {
            action = "hold";
        }
        else
        {
            action = "shed";
        }

        Console.WriteLine("readers=" + readers + " admitted=" + admitted + " remaining=" + remaining + " " + action);
    }
}
remaining capacity The reader pool capacity is modeled with a scalar counter, so the remaining slots stay deterministic and free of semaphore identity while driving the remediation action.