Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

sunet: seval do/timeout problem (i want to kill a thread)

2 views
Skip to first unread message

Michal Maruška

unread,
Apr 2, 2002, 11:36:27 AM4/2/02
to

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 ?

Michal Maruška

unread,
Apr 2, 2002, 6:50:36 PM4/2/02
to

m...@maruska.dyndns.org (Michal Maruška) writes:

> 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.

Michal Maruška

unread,
Apr 3, 2002, 3:42:08 AM4/3/02
to

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


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)?

Martin Gasbichler

unread,
Apr 3, 2002, 4:07:09 AM4/3/02
to

>>>>> "Michal" == Michal Maruška <m...@maruska.dyndns.org> writes:

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

Martin Gasbichler

unread,
Apr 3, 2002, 4:17:49 AM4/3/02
to

>>>>> "Michal" == Michal Maruška <m...@maruska.dyndns.org> writes:

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

0 new messages