Adding and deleting elements of dynamic type at same time

Hi All,

Consider a dynamic type like queue.

There are 2 functions push_func & pop_func, where push_func pushes elements and pop_func pops / deletes elements ( in FIFO ordering )

I was curious to know if there are any possible side-effects in case there more than 1 active calls to both of these functions at a given time

Eg: 3 calls to push_func and 3 calls to pop_func in a fork join

(1) Assuming that the push & pop is in FIFO ordering, are there possible side-effects to this ?

(2) What if the ordering is random ( non FIFO ), would there be a side-effect in this case ?

A queue already has push_front()/push_back() and pop_front()/pop_back() functions. Are you defining new functions?

These functions are atomic, in that a single operation will complete prior to another operation starting. This means that you can’t have two active calls at the same time.

You could potentially create race conditions where you may pop before you push and not get the expected results, but that would be due to poor coding styles.

I call these functions from my assertion