A non-transitory computer readable medium comprising executable code thereon for facilitating communications between one or more producers and one or more consumers, the computer readable medium comprising executable code for:
- a first interface for opening communications between an invoking container and other containers using said event queue, said first defined interface being invoked by producers and consumers of said event queue prior to using said event queue for communicating with other containers, said first interface returning a reference to said event queue;
- a second interface used by a consumer of said event queue to register for notification regarding occurrences of one or more events, said second interface including a parameter indicating said reference used by said consumer;
- a third interface used by a producer of said event queue to post one or more notifications regarding one or more occurrences of one or more events to a plurality of consumers, each consumer receiving a notification on a corresponding one of a plurality of event notification lists used by said consumer regarding events for which said each consumer has registered using said second interface;
- and
- a fourth interface used by a consumer to retrieve event notifications from an event notification list regarding events for which the consumer is registered, wherein if the consumer is executing in user space and the event notification list of the consumer is located in shared memory, said consumer retrieves the event notifications therefrom without proxying into kernel space, and wherein if said event notification list of the consumer is not located in shared memory, said consumer proxies into kernel space to retrieve the event notifications therefrom;
- wherein the producer uses the third interface to post a first event notification to said plurality of event notification lists in accordance with a pending policy whereby processing of the producer is blocked if any of the plurality of event notification lists do not have a free entry to post the first event notification, and the computer readable medium further comprises code for:
- posting, by said producer, said first event notification to a portion of said plurality of event notification lists;
- and
- blocking execution of said producer because an event notification list of the first consumer does not have a free entry to post the event notification, wherein said blocking blocks said producer from posting the first event notification to the event notification list and any other remaining ones of the plurality of event notification lists not included in the portion, wherein the event notification list of the first consumer is not included in said portion of said plurality of said event notification lists;
- wherein said event notification list is implemented using a ring buffer, and wherein said event queue is used by different containers for communicating therebetween, each of said different containers executing in a context of its own address space that is different from address spaces of other containers.