Article View: comp.sys.next.programmer
Article #1424AppKit event loop & MathLink interaction
From: Rainer Staringer
Date: Mon, 12 Oct 1992 08:49
Date: Mon, 12 Oct 1992 08:49
27 lines
1746 bytes
1746 bytes
I am using Mathematica via the MathLink protocol in an IB palette, and I found the following strange interaction between the event loop and the MathLink functions: If I call the MLStart() function in -appDidInit: or anywhere after [NXApp run] is called, it will work (sort of) but the first call to MLNewPacket() will hang forever. If I move the MLStart() call into the main() function and call it before [NXApp run] everything will work. But of course this is not possible in an IB palette (at least if you want it to work in test mode), so I would like to know what the cause could be for this sort of failure. I think MLStart does not much more than popen() does, i.e. open a pipe, fork, and exec. MLNewPacket() does a select() to check if the pipe is still there, then a read(). What does [NXApp run] do that might cause this to fail? I am also using the Sybase DB library in the same palette, if that matters. I am pretty sure that my MathLink code is correct because I basically copied WRI's sample front end program. I am doing this under 2.1/2.2; I haven't tried it under 3.0 yet. Thanks in advance for any pointers! Rainer -- Rainer Staringer | rainer@fml.tuwien.ac.at Financial Markets Lab, TU Vienna | +43 (1) 58801/8138
Technical Details
Message-ID:
<1992Oct12.084924.8138@email.tuwien.ac.at>Path:
arc1-ca.pugleaf.net!sparky!uunet!news.univie.ac.at!email!newsShow Full Headers
Complete Article Headers
Newsgroups: comp.sys.next.programmer Path: arc1-ca.pugleaf.net!sparky!uunet!news.univie.ac.at!email!news From: rainer@ruble.fml.tuwien.ac.at (Rainer Staringer) Subject: AppKit event loop & MathLink interaction Message-ID: <1992Oct12.084924.8138@email.tuwien.ac.at> Sender: news@email.tuwien.ac.at Nntp-Posting-Host: wampum.fml.tuwien.ac.at Reply-To: rainer@eimoni.tuwien.ac.at Organization: Technical University of Vienna Date: Mon, 12 Oct 1992 08:49:24 GMT Lines: 27