To implement struct and 3 functions, use pthread_mutex_t and pthread_cond_t to synchronize data structure and use malloc() and free().
To implement the struct and the three functions, you will need to define a struct that includes at least one variable of type pthread_mutex_t and one of type pthread_cond_t to synchronize access to the data structure.
Then, you will need to write the three functions:
pq_insert, pq_remove, and pq_peek.
To implement pq_insert, you will need to insert the given item into the given queue at the given priority, without blocking.
You can use pthread_mutex_t and pthread_cond_t to ensure that the queue is accessed safely by multiple threads at the same time.
Negative priorities are allowed.
To dynamically adjust the size of the data structure, you will need to use malloc() and free().
For more such questions on Struct: