From: Jim I. <ji...@ap...> - 2002-03-06 18:49:42
|
Mach messages are not all that bad to handle. The one thing to note is that the mach_msg call - which is the core call to send or receive messages - is a blocking call. This means that you will have to wait for the message on a separate thread to keep from blocking the rest of Tcl. If you want to hook this up to the Tcl event loop, the best thing to do is to create a pipe and make a Tcl File Channel out of the read end. The file channel gets added to the Tcl notifier set, and then when you get a Mach message in the thread handling the ae port, you just write the buffer to the pipe, and this will wake Tcl up out of its select wait, and it can handle the event. Mach messages are also RPC's so the mach_msg call on the sender's side won't return till it gets a reply message from Tcl. I don't know how AE is layered on top of this. It may be you can reply right away to free the sender, and then stuff the actual event reply into another message later on. All this is doable in Tcl, but might be a little tricky... Jim On Wednesday, March 6, 2002, at 06:38 AM, Jon Guyer wrote: > At 12:14 AM +1100 3/7/02, Daniel A. Steffen wrote: >> some more info on all this from steve z on carbondev > > Very interesting info, Daniel. If I ever return through my long and > harrowing trek through statusBarLand (soon, I think), I'd be happy to > dive into this. > > -- > > > Jonathan E. Guyer > <http://www.his.com/jguyer/> > > > _______________________________________________ > Tcl-mac mailing list > Tc...@li... > https://lists.sourceforge.net/lists/listinfo/tcl-mac > -- Jim Ingham ji...@ap... Developer Tools - gdb Apple Computer |