How to sync up behavior between two analysis imp write function in scoreboard

I have a system which has two inputs sending data randomly with address attached. To take it easy, we can think of DUT sends out data out of order. So just need an associate array to compare input and output data. 
But there is a corner case that, if two inputs sending data to the same address at the same cycle, port 0 will have higher priority to be sent out. So my question is, how to handle scoreboard two write function, to know if they both trying to access the same address of an associative array at the same cycle, I should put p0 data first, then p1. 
I'm thinking I can use a semaphore with only 1 key. On port0 write function, it will call "get" first then after putting in the queue call "put". While in port1, if will use "try_get" to wait. I am not sure if this is the best answer to do so or there is any other more common way.

In reply to aaaaaa:

On the scorboard level ther is no timing. Only the order of the transactions is important. If port0 has the priority it writes prior to port1.
Is it physically possible to write to the same address at exactly the same time (clock cycle)? I do not believe so.