guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Threads + pipes = bad?


From: Robert Marlow
Subject: Threads + pipes = bad?
Date: 24 Jul 2003 15:48:16 +0800

Hi all 

I'm getting some problems with my use of a pipe within a thread in a
program I'm writing. Platform is Solaris 8.

Anyway, here's an example of a function I've called from within the
thread:

(define (email message)
  (let* ((address (assoc-ref message 'address))
         (message-text (assoc-ref message 'text))
         (mail-pipe (open-output-pipe (string-append "mailx -s \'" 
                                                     subject "\' "
                                                     address)))
   (display message-text mail-pipe)
   (close-pipe))) 


And here's the errors I get:

In thread:
ERROR: In procedure dup2:
ERROR: Bad file number

and 

In thread:
ERROR: In procedure waitpid:
ERROR: No child processes


Can anyone shed some light on what's happening here? Is there contention
for file descriptors or something?

TIA


-- 
Regards,

Robert Marlow









reply via email to

[Prev in Thread] Current Thread [Next in Thread]