[Barrelfish-users] Questions about IDC: Poll or Interrupt
Baumann Andrew
andrewb at inf.ethz.ch
Wed Mar 14 22:42:27 CET 2012
Hi,
Barrelfish/Flounder IDC is asynchronous, but it is not concurrent. Unless you create a pool of threads that call event_dispatch() (which is what you seem to have done), there is no other thread that will execute the callbacks for you. This is by design ¨C you shouldn¡¯t be forced to deal with non-deterministic concurrency just to get the benefits of asynchronous messaging.
Note that if you do want the concurrency of multiple threads, the onus is on you to correctly serialise their operations when they interact with shared state such as the binding objects. The binding operations (i.e. message send, receive, etc.) are not thread-safe.
Andrew
From: Shi Jinghao (Ê·¾ºÆ£© [mailto:jhshi at cs.hku.hk]
Sent: Wednesday, 14 March, 2012 7:14
To: barrelfish-users at lists.inf.ethz.ch
Subject: [Barrelfish-users] Questions about IDC: Poll or Interrupt
Hi,
I am recently working with IDC in Barrelfish, using the API generated by Flounder. I found that I need
to use a separate polling thread to poll the waitset, so that my call backs can get called.
For example, when sending a message: dummy__msg_tx(binding, MKCONT(send_cb, NULL), value)
Since the send is asynchronous, I can continue to do other stuff after this call. However, I expect that
my send_cb will be called (*interrupt*) once the send is success, which is not the case: I must manually poll the
binding's waitset using event_dispatch to get send_cb get called.
I now use a separate polling thread to do all this stuff and it works. But I was wondering:
- Is it designed as this way? Or I don't actually need to poll, just I don't know how...
- If this is the way as designed, then why? This seems not that "event-driven", right?
Thanks for your reading and forgive me if I asked a stupid question.
Regards,
Jinghao
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.inf.ethz.ch/pipermail/barrelfish-users/attachments/20120314/5c4848b6/attachment.html
More information about the Barrelfish-users
mailing list