CheckAbort inside MathLink functions?
- To: mathgroup at smc.vnet.net
- Subject: [mg118136] CheckAbort inside MathLink functions?
- From: Alexey <lehin.p at gmail.com>
- Date: Thu, 14 Apr 2011 04:48:04 -0400 (EDT)
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