How to implement semaphore with priority request to bypass other pending request?

In reply to rahulkumarbudhwani:

You are not going to be able to implement this with a single semaphore. This question is difficult to answer without knowing the architecture of your testbench. We don’t know what a “request” looks like, or how process communication works. If you were using the UVM, it sequuence/sequencer/driver mechanism is already set up to handle this very easily.

But if you are doing this on your own, we need to know a lot of things like how threads are putting in requests, and is there a different thread servicing the requests? Is there a thread per requestor, and can each have several pending requests. How many priority levels are there and how are requests with the same priority level handled?