[MPI?] which API should i use for this?

I have a need to send an "event" to the "main thread's event loop". this may be done from a preemptive thread, a cooperative thread, a timer, or even the main thread itself. i want it to be posted into the event stream and handled in the order that events get processed on the main thread. would i use 'MPI'? or 'interprocess'? or is there a 'thread' way to do this? if it's MPI, what would be the right call? i'm coming from Mac land where i have traditionally used PostEventToQueue()

sorry, my ISP had blocked all mail from this mailing list. it is now white listed. can any repliers or some kind person please re-send any replies? thanks -dave On Oct 7, 2009, at 12:18 PM, David M. Cotter wrote:
I have a need to send an "event" to the "main thread's event loop".
this may be done from a preemptive thread, a cooperative thread, a timer, or even the main thread itself. i want it to be posted into the event stream and handled in the order that events get processed on the main thread.
would i use 'MPI'? or 'interprocess'? or is there a 'thread' way to do this? if it's MPI, what would be the right call?
i'm coming from Mac land where i have traditionally used PostEventToQueue()

I don't think there were any replies yet. Not sure what the x-platform/boost solution would be, but if you are now on Windows, I'd use PostMessage() (if there's no boost solution). Tony On Wed, Oct 7, 2009 at 8:52 PM, David M. Cotter <me@davecotter.com> wrote:
sorry, my ISP had blocked all mail from this mailing list. it is now white listed. can any repliers or some kind person please re-send any replies? thanks
-dave
On Oct 7, 2009, at 12:18 PM, David M. Cotter wrote:
I have a need to send an "event" to the "main thread's event loop".
this may be done from a preemptive thread, a cooperative thread, a timer, or even the main thread itself. i want it to be posted into the event stream and handled in the order that events get processed on the main thread.
would i use 'MPI'? or 'interprocess'? or is there a 'thread' way to do this? if it's MPI, what would be the right call?
i'm coming from Mac land where i have traditionally used PostEventToQueue()
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

David M. Cotter wrote:
I have a need to send an "event" to the "main thread's event loop".
this may be done from a preemptive thread, a cooperative thread, a timer, or even the main thread itself. i want it to be posted into the event stream and handled in the order that events get processed on the main thread.
would i use 'MPI'? or 'interprocess'? or is there a 'thread' way to do this? if it's MPI, what would be the right call?
i'm coming from Mac land where i have traditionally used PostEventToQueue()
David, I'll let others who know other libraries better than I talk about them, but I would suggest against MPI for this. The goal of MPI is cluster computing, and that does not seem to be what you are doing. I could come up with a way to write this in boost.MPI, but I don't think it would be a good way. John

-----Original Message----- From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] On Behalf Of David M. Cotter Sent: Wednesday, October 07, 2009 3:19 PM To: boost@lists.boost.org Subject: [boost] [MPI?] which API should i use for this?
I have a need to send an "event" to the "main thread's event loop".
this may be done from a preemptive thread, a cooperative thread, a timer, or even the main thread itself. i want it to be posted into the event stream and handled in the order that events get processed on the main thread.
would i use 'MPI'? or 'interprocess'? or is there a 'thread' way to do this? if it's MPI, what would be the right call?
i'm coming from Mac land where i have traditionally used PostEventToQueue()
Before I start please understand that I don't have any experience programming OS X. Even so, PostEventToQueue appears to be part of the OS X "carbon" API. There are similar sorts of event posting functions as part of the GUI frameworks in both MS Windows and X windows but AFAIK boost doesn't directly support any of the sorts of event notifications that are tied into the windowing system. However, maybe a combination of the threadpool library and/or the signals2 library would fit your needs. --glenn

It really depends on what kind of applications you are writing and what other libraries your app is built on. If you are writing your apps from scratch, it will be easier. For example if it is a networking app using boost.asio, you can easily post events to asio's main threads. You can also have a look of my join/channel libs (http://channel.sourceforge.net). However if your app is architectured around other libs such as some GUI frameworks. Most possibly the app main thread is already taken by the framework. Better check out the frameworks' threading / synchronization policy and very possibly it already provide some native api to post an event to its main thread safely. Regards Yigong On Thu, Oct 8, 2009 at 12:47 PM, Schrader, Glenn <gschrad@ll.mit.edu> wrote:
-----Original Message----- From: boost-bounces@lists.boost.org [mailto: boost-bounces@lists.boost.org] On Behalf Of David M. Cotter Sent: Wednesday, October 07, 2009 3:19 PM To: boost@lists.boost.org Subject: [boost] [MPI?] which API should i use for this?
I have a need to send an "event" to the "main thread's event loop".
this may be done from a preemptive thread, a cooperative thread, a timer, or even the main thread itself. i want it to be posted into the event stream and handled in the order that events get processed on the main thread.
would i use 'MPI'? or 'interprocess'? or is there a 'thread' way to do this? if it's MPI, what would be the right call?
i'm coming from Mac land where i have traditionally used PostEventToQueue()
Before I start please understand that I don't have any experience programming OS X. Even so, PostEventToQueue appears to be part of the OS X "carbon" API. There are similar sorts of event posting functions as part of the GUI frameworks in both MS Windows and X windows but AFAIK boost doesn't directly support any of the sorts of event notifications that are tied into the windowing system. However, maybe a combination of the threadpool library and/or the signals2 library would fit your needs.
--glenn _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
participants (5)
-
David M. Cotter
-
Gottlob Frege
-
John Phillips
-
Schrader, Glenn
-
Yigong Liu