Is push/pop method of queue process-safe for different process

i’m using push/pop method in different process. when pushing or popping queue, do i need explicitly a lock/unlock for the operation of queue.
is the lock necessary or not?
thanks, everyone!

example as follow:

int que[$];
semaphore lock;
fork
  forever begin
    some action;
    lock.get(1);
    que.push_back(item);
    lock.put(1);
  end
  forever begin
    some action;
    lock.get(1);
    que.pop_front(item);
    lock.put(1);
  end

No. Just check q size before pop.

In reply to Halfboil220:

understood.
thanks

In reply to zhang jingbo:

A SystemVerilog mailbox does exactly this.