[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Threads + pipes = bad?
From: |
Robert Marlow |
Subject: |
Re: Threads + pipes = bad? |
Date: |
24 Jul 2003 23:07:40 +0800 |
Nevermind, I think I fixed it by calling the function while the mutex
was locked. Bummar though; the whole point of using threads was to get
procedures like this one working concurrently.
I haven't really played with threads before... is there any reason I
shouldn't be able to unlock the mutex and _then_ call a procedure with a
pipe such as below?
I'm guessing the way to speed the processing up without taking it out of
the mutex lock is to put the procedure in a separate executable script,
yeah?
On Thu, 2003-07-24 at 15:48, Robert Marlow wrote:
> 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
>
>
>
>
>
>
>
> _______________________________________________
> Guile-user mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/guile-user
--
Regards,
Robert Marlow