Re: Lazy timeout request...
Hi,
OK, then I think the best is to use process-run-function to run the students’ code, and process-join to wait for their code to finish. process-join takes a timeout parameter, so when process-join returns nil, the code executes for too long. You can then use process-terminate or process-kill to terminate that process.
Pascal
> On Feb 17, 2016, at 13:16, Antoniotti Marco <antoniotti.marco@disco.unimib.it> wrote:
>
>
> Hi Pascal
>
> thanks. I had a cursory look at process-wait-with-timeout and process-wait-with-local-timeout, however, they seem to me the building blocks for what I have in mind.
>
> Essentially FORM should be a “simple” (YMMV) one, although it may run for a long time; especially not a form that mucked the scheduler and or other multiprocessing thingies.
>
> Let me explain the very, very basic use-case I have :)
>
> I teach Common Lisp to (a lot of) students. I need to grade (a lot of) projects and I use a simple unit tester to test results (Franz’s). Unfortunately, the id… ahem, the young minds striving to learn often write “loopy” programs. I need a timeout to interrupt the computation and do some cleanup.
>
> Cheers
> —
> MA
>
> PS I just downloaded you PLoS One on elPrep :)
>
>
>
>> On Feb 17, 2016, at 10:50 , Costanza, Pascal <pascal.costanza@intel.com> wrote:
>>
>>
>> Hi,
>>
>> There is process-wait-with-timeout and process-wait-with-local-timeout.. However, it depends on what you want to happen in ‘form, because that may require different solutions.
>>
>> Can you be more specific?
>>
>> Pascal
>>
>> On Feb 17, 2016, at 10:40, Antoniotti Marco <antoniotti.marco@disco.unimib.it<mailto:antoniotti.marco@disco.unimib.it>> wrote:
>>
>> Hi
>>
>> this is a lazy request; in the sense that I’d like a ready made solution for LW :) :) I.e., it has nothing to do with lazy evaluation.
>>
>> I’d like a macro with the following signature (more or less)
>>
>> WITH-TIMEOUT timeout form
>> :on-timeout (lambda () nil) ; Or maybe: (lambda () (error 'timeout :form form))
>> :on-normal-completion (lambda (&rest args) (apply #’values args))
>>
>> There was a discussion about such a beast in 2011, but it had a simpler interface and I don’t want to wrap my head too much around all the vagaries of multiprocessing :)
>>
>> Thanks
>>
>> —
>> MA
>>
>>
>>
>>
>> --
>> Pascal Costanza
>> The views expressed in this email are my own, and not those of my employer.
>>
>>
>>
>> Intel Corporation NV/SA
>> Kings Square, Veldkant 31
>> 2550 Kontich
>> RPM (Bruxelles) 0415.497.718.
>> Citibank, Brussels, account 570/1031255/09
>>
>> This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.
>>
>> _______________________________________________
>> Lisp Hug - the mailing list for LispWorks users
>> lisp-hug@lispworks.com
>> http://www.lispworks.com/support/lisp-hug.html
>
> --
> Marco Antoniotti, Associate Professor tel. +39 - 02 64 48 79 01
> DISCo, Università Milano Bicocca U14 2043 http://bimib.disco.unimib.it
> Viale Sarca 336
> I-20126 Milan (MI) ITALY
>
> Please check: http://cdac.lakecomoschool.org
>
> Please note that I am not checking my Spam-box anymore.
> Please do not forward this email without asking me first.
>
>
>
>
>
>
> _______________________________________________
> Lisp Hug - the mailing list for LispWorks users
> lisp-hug@lispworks.com
> http://www.lispworks.com/support/lisp-hug.html
--
Pascal Costanza
The views expressed in this email are my own, and not those of my employer.
Intel Corporation NV/SA
Kings Square, Veldkant 31
2550 Kontich
RPM (Bruxelles) 0415.497.718.
Citibank, Brussels, account 570/1031255/09
This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.
_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html