[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
25 Sep 2001 09:51:34 +0200
Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7
"Jorgen 'forcer' Schaefer" <address@hidden> writes:
> Manuel Giraud <address@hidden> writes:
> > (begin-thread
> > (let loop ()
> > (display "My endless treatment\n")
> > (sleep 5)))
> > But this thread is just active for one display and stops.
> You're not looping :)
> Add a call to (loop) after the sleep...
It was just a typo, here is an example of my server and client :
;;; Server loop
(let loop ()
;; Waiting for some message.
(let* ((pair (accept sock))
(sock (car pair))
(conn (cdr pair))
(rcv (read sock)))
;; A new thread that will endlessly evaluate the received
(let looping ()
;; Back to waiting.
;;; The message : a s-expression.
(define message '(display "hello\n"))
;;; Connect and send
(connect sock AF_INET (car (hostent:addr-list (gethost sname))) port)
(write message sock)
With the begin-thread, I can't see any "hello" but it works without. I
have to say that a standalone example like :
(let loop ()
works well. So what's wrong ?
"Never imagine yourself not to be otherwise than what it might appear
to others that what you were or might have been was not otherwise than
what you had been would have appeared to them to be otherwise"
Re: Threads, Daniel Skarda, 2001/09/24
- Threads, Manuel Giraud, 2001/09/24
- Re: Threads, Jorgen 'forcer' Schaefer, 2001/09/24
- Re: Threads,
Manuel Giraud <=