Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #1672 > unrolled thread

CheckAbort inside MathLink functions?

Started byAlexey <lehin.p@gmail.com>
First post2011-04-14 08:58 +0000
Last post2011-04-14 08:58 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  CheckAbort inside MathLink functions? Alexey <lehin.p@gmail.com> - 2011-04-14 08:58 +0000

#1672 — CheckAbort inside MathLink functions?

FromAlexey <lehin.p@gmail.com>
Date2011-04-14 08:58 +0000
SubjectCheckAbort inside MathLink functions?
Message-ID<io6cus$do8$1@smc.vnet.net>
Hello,

It seems that that such MathLink functions as LinkWrite and LinkRead have
something like its own internal CheckAbort that absorbs user-generated
aborts, and does not propagate them further.

This can be easily shown with LinkRead:

link = LinkLaunch[First[$CommandLine] <> " -mathlink"];
LinkRead[link];
LinkWrite[link, Unevaluated[Pause[100]]];
CheckAbort[AbortProtect[Print[LinkRead[link]]], Print["!!"]]

If we press Alt+. after evaluating the above code we get only the following
output:

During evaluation of In[6]:= ReturnPacket[$Aborted]

But Print["!!"] is not evaluated although we have generated Abort[] exactly
inside CheckAbort.

One can see that the abort we made by pressing Alt+. was absorbed by LinkRead.

My problem is that it breaks my own flow control of evaluation based on
CheckAbort.

Is there a way to intercept aborts absorbed by such functions as LinkRead
and LinkWrite for having ability to catch user-generated aborts?

Alexey

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web