Sharing a queue between two classes

Can someone point me to an example where a queue is being shared between two different classes? I want to fill the queue with some data and both classes get the same element out, do some processing and then get the next element out and so on.

Thanks

In reply to UVM_learner6:


package some_pkg;
  int some_queue [$];
endpackage : some_pkg

class class_a;  
  function new;
    some_pkg::some_queue.push_front(32);
  endfunction : new
endclass : class_a

class class_b;
  function new;
    some_pkg::some_queue.push_front(16);
  endfunction : new
endclass : class_b

In reply to sbellock:

fill the queue with some data and both classes get the same element out

This won’t be fulfilled.