MathGroup Archive 1999

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: How to interrupt a running evaluation in MathLink

  • To: mathgroup at
  • Subject: [mg17061] Re: How to interrupt a running evaluation in MathLink
  • From: Jens-Peer Kuska <kuska at>
  • Date: Wed, 14 Apr 1999 02:12:07 -0400
  • Organization: Universitaet Leipzig
  • References: <7es12a$>
  • Sender: owner-wri-mathgroup at


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

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.


tobiasoed at wrote:
> Jens-Peer Kuska <kuska at> 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 ==----------
>       Search, Read, Discuss, or Start Your Own

  • Prev by Date: Re: How display negative contours with dashed lines?
  • Next by Date: Re: ContourPlot: non-rectangular domains?[2]
  • Previous by thread: Re: How to interrupt a running evaluation in MathLink
  • Next by thread: Problem Display Format