Re: How to interrupt a running evaluation in MathLink
- To: mathgroup at smc.vnet.net
- Subject: [mg17061] Re: How to interrupt a running evaluation in MathLink
- From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
- Date: Wed, 14 Apr 1999 02:12:07 -0400
- Organization: Universitaet Leipzig
- References: <7es12a$c7b@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Hi,
mathlink.h ? The file has several usefull comments.
Any program processed by mprep install a message handler
that answer to the messages.
You will found the comments in any c-program passed by mprep.
You can install your own message handler to answer to
MLAbortMessage and MLInterruptMessage
in a different way. Since the default message handler handel
abort and interrupt messages in the same way
case MLAbortMessage:
case MLInterruptMessage:
MLAbort=1; break;
I use the save version to avoid problems with a possible message
packet -- it was just a defensive programing style.
I'm extrem carefull with MathLink's data/message exchange because
I found it very fragile compared with other process/network
communication protocols. MPI stands like a wall, compared with
MathLink.
OK -- MathLink is not full documented, the FrontEnd programming
(more stuff, needed by more people) is not full documented, the
funny "implementation notes" in the Mathematica book
can't be called "fully documented", the style sheets for the notebooks
are not fully documented ...
I can continue here over several pages.
Regards
Jens
tobiasoed at my-dejanews.com wrote:
>
> Jens-Peer Kuska <kuska at informatik.uni-leipzig.de> wrote
>
> >Hi Robert,
> >
> >on my SGI the abort with:
> >
> > MLPutMessage(link,MLAbortMessage);
> > MLFlush(link);
> > while(MLReady(link) && MLNextPacket(link)!=MENUPKT &&
> > MLError(link)==MLEOK) {
>
> [ snip ]
>
> Now Jens tell me where MLPutMessage() is documented ???
> Further I think that you won't get a MenuPacket after this
> but the calculation will abort. To get the menu use
>
> MLPutMessage(link,MLInterruptMessage);
>
> at least this how it behaves on
> hpux10.01 using Mathematica 3.0 for HP-UX PA-RISC
>
> Tobias
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own