class_docstr: Simple fixed capacity shared memory queue of fixed size messages.
  Writing to a full queue fails, attempt to get from an empty queue blocks until data is
  available or the queue is closed.
class_docstr_tok: ["Simple","fixed","capacity","shared","memory","queue","of","fixed","size","messages",".","Writing","to","a","full","queue","fails",",","attempt","to","get","from","an","empty","queue","blocks","until","data","is","available","or","the","queue","is","closed","."]
code: def __init__(self, mp, capacity):
      self.lock = mp.Lock()
      self.cv_not_empty = mp.Condition(self.lock)
      self.capacity = capacity
      self.meta = QueueMeta(capacity, 0, 0, 0)
      self.meta_size = align_up(self.meta.get_size(), self.ALIGN_UP_MSG)
      dummy_msg = self.MSG_CLASS()
      self.msg_size = align_up(dummy_msg.get_size(), self.ALIGN_UP_MSG)
      self.shm_capacity = align_up(
          self.meta_size + capacity * self.msg_size,
          self.ALIGN_UP_BUFFER,
      )
      self.shm = shared_mem.SharedMem.allocate(self.shm_capacity)
      self.is_closed = False
      self._init_offsets()
      self._write_meta()
  
imports: from typing import List, Optional
  import os
  import threading
  from nvidia.dali._multiproc import shared_mem
  from nvidia.dali._multiproc.messages import Structure, ShmMessageDesc
  from nvidia.dali._multiproc.shared_batch import _align_up
label_desc: Use image node_id 1 to create a new ShmQueue object  with example: obj = ShmQueue(mp, capacity)