Re: [racket-users] How to limit memory usage and raise out-of-memory error?

2018-08-10 Thread Shu-Hung You
Cool! That does the job. Thank you. On Fri, Aug 10, 2018 at 3:57 PM, Matthew Flatt wrote: > For the second part, use `thread/suspend-to-kill` to create a thread > that is merely suspended when its custodian is shut down, and then you > can use `(continuation-marks thread-id)` to get the thread's

Re: [racket-users] How to limit memory usage and raise out-of-memory error?

2018-08-10 Thread Matthew Flatt
For the second part, use `thread/suspend-to-kill` to create a thread that is merely suspended when its custodian is shut down, and then you can use `(continuation-marks thread-id)` to get the thread's continuation marks at the point where it was suspended. You'll need to wait until either the

[racket-users] How to limit memory usage and raise out-of-memory error?

2018-08-10 Thread Shu-Hung You
I'm running a thread with memory limit using custodian-limit-memory. How do I reliably detect whether the thread I'm running was terminated normally or aborted by custodian shutdown? Plus, is it possible to obtain the context at the time the memory limit was exceeded? I can think these two: 1.