Semaphore

1)what is the difference between mailbox and semaphore? What happens if you have a code that puts more keys back than it gets for a semaphore?

In reply to anvesh dangeti:

Semaphore is like a bucket which holds a specific number of keys. Used to gate processes until you have sufficient resources available.
Mailbox is used for passing data types across processes.

It’s possible to put in more keys than the semaphore was initialized with. You will not see any error.

In reply to anvesh dangeti:
https://verificationacademy.com/forums/systemverilog/question-internals-mailbox-built-class#reply-53565
https://verificationacademy.com/forums/systemverilog/semaphore-process-returning-more-keys-got-processing.#reply-42501