Jump to content

collect trasactions from different threads at any given time


ankitks

Recommended Posts

I have a function (nb_trasport_fw) that is been called few times in same cycle

...nb_transport_fw(...) {

   ...

   queue.push_back(trans);

   e.notify()

}

 

I also have a thread that's waiting on event 'e'. 
 

arbitrate() {

wait(e);

//do I have all the transactions in my queue.

//arbitrate among trasactions in queue.

}

Basically I need a point where I collect all the transactions and arbitrate among them. I can't really look at single transaction and make a decision.  Challenging part is I don't know if function will be called 0,1 or N times.

 

Thanks

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...