[]Save and Threads

General APL language issues
Post Reply
paulmansour
Posts: 431
Joined: Fri Oct 03, 2008 4:14 pm

[]Save and Threads

Post by paulmansour »

Hi all,

I'm looking at providing some debugging aids for a new desktop app. Obviously one nice thing to provide on an error is a saved, suspended copy of the WS, to be sent back to the support team in the home office, which is trivial with []SAVE. However, if you have any threads running, []SAVE does not work. Any work arounds for this? Is this a fundamental unsolvable problem with threads, or is it something that might get enhanced in future versions?

Also, are there other common techniques I should be looking at to accomplish the same goal - debugging a problem off site?

Thanks for any pointers.

Paul
Vince|Dyalog
Posts: 439
Joined: Wed Oct 01, 2008 9:39 am

Re: []Save and Threads

Post by Vince|Dyalog »

Hi Paul,

There is an undocumented method you could use:
2 ⎕NQ '.' 'dumpws' filename
where filename is a unique char vector you could generate, such as
'c:\mysnapshots\saved_13Aug2010_11am.cor'

This method creates a file which is in the same format as our aplcores. You should then be able to ⎕CY from this dump file. Please note that ⎕CY will only be able to get local variables from the currently running thread in the file. So, you might like to create global variables with enough information about where your program is and what it is doing.

You could also write to your own external log file.

We might be able to ⎕SAVE with running threads in some future version.

Regards,

Vince
paulmansour
Posts: 431
Joined: Fri Oct 03, 2008 4:14 pm

Re: []Save and Threads

Post by paulmansour »

Vince,

Thanks, very helpful.

Paul
Post Reply