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


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

CheckAbort inside MathLink functions?

X-FeedAbuse http://nntpfeed.proxad.net/abuse.pl feeded by 88.191.16.109
Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.dougwise.org!nntpfeed.proxad.net!nospam.fr.eu.org!usenet-fr.net!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!news.glorb.com!news2.glorb.com!news.mv.net!newspump.sol.net!post2.nntp.sol.net!posts.news.twtelecom.net!nnrp3.twtelecom.net!not-for-mail
From Alexey <lehin.p@gmail.com>
Newsgroups comp.soft-sys.math.mathematica
Subject CheckAbort inside MathLink functions?
Date Thu, 14 Apr 2011 08:58:04 +0000 (UTC)
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Sender steve@smc.vnet.net
Approved Steven M. Christensen <steve@smc.vnet.net>, Moderator
Message-ID <io6cus$do8$1@smc.vnet.net> (permalink)
Lines 31
NNTP-Posting-Date 14 Apr 2011 07:58:37 GMT
NNTP-Posting-Host 3e33035f.news.twtelecom.net
X-Trace DXC=1Nm4oo7GG>HVS1USibAf`FC_A=>8kQj6MY;@_o827nGC=9Zm4XKEbDOEFiONJ7[GoFCj<o7TT2AcD
X-Complaints-To abuse@twtelecom.net
Xref x330-a1.tempe.blueboxinc.net comp.soft-sys.math.mathematica:1672

Show key headers only | View raw


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

Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

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

csiph-web