i have been looking at SEVAL handler in sunet. It works only if i remove the
| (do/timeout 10
Well, i removed it and making some other changes it started to work { i wanted
to eval (+ 2 2) }.
However I would like to implement do/timeout with threads. But how to kill
one ?
BTW: i am new to threads. Can someone confirm that the s48 implementation is
good---fast (under linux)? Is it possible to have 2 emacs sessions with 2
threads of the same process ?
> However I would like to implement do/timeout with threads. But how to kill
> one ?
i have found a similar function here:
http://www.scsh.net/post/alahandler.html
but i want to kill the thread.
> i have been looking at SEVAL handler in sunet. It works only if i remove the
> | (do/timeout 10
Going back to fork {i.e. do/timeout} in SEVAL, and commenting out in seval.scm
;(http-log "Seval sexp:~%~s~%\n" s)
which apparently "blocks" the server,
... i see that the output of the subprocess goes to stdout of the server at the
launch time. I suspect (being warned by the scsh manual) that the output of the
request processing goes to a string-port. Can i debug it (type of the port)?
Michal> i have been looking at SEVAL handler in sunet. It works only if i remove the
Michal> | (do/timeout 10
Michal> Well, i removed it and making some other changes it started to work { i wanted
Michal> to eval (+ 2 2) }.
Michal> However I would like to implement do/timeout with threads. But how to kill
Michal> one ?
You can kill a thread with the procedure KILL-THREAD! from the
structure THREADS-INTERNAL. However, this is dangerous as the thread
may hold resources which are not given back when the thread is
killed. I'm not sure if there exists plans for a cleaner way to
terminate threads in S48.
Michal> BTW: i am new to threads. Can someone confirm that the s48 implementation is
>> good---fast (under linux)? Is it possible to have 2 emacs sessions with 2
>> threads of the same process ?
The thread implementation of s48 is built in user-space and thereby
completely independent of the OS. It is also extremely fast in terms of
thread creation and context switching.
--
Martin
Michal> m...@maruska.dyndns.org (Michal Maruška) writes:
>> i have been looking at SEVAL handler in sunet. It works only if i remove the
>> | (do/timeout 10
Michal> Going back to fork {i.e. do/timeout} in SEVAL, and commenting out in seval.scm
Michal> ;(http-log "Seval sexp:~%~s~%\n" s)
Michal> which apparently "blocks" the server,
Doing a fork in the httpd server is currently not a good idea as the
threads are duplicated this way. We intend to fix this within the next
few days.
Michal> ... i see that the output of the subprocess goes to stdout of the server at the
Michal> launch time. I suspect (being warned by the scsh manual) that the output of the
Michal> request processing goes to a string-port. Can i debug it (type of the port)?
I don't see any redirections to string-ports in seval.
--
Martin