unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Robert Marlow <bobstopper@australispro.com.au>
Subject: Re: Threads + pipes = bad?
Date: 24 Jul 2003 23:07:40 +0800	[thread overview]
Message-ID: <1059059262.564.16.camel@zuul> (raw)
In-Reply-To: <1059032896.10133.41.camel@helicon>

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
> Guile-user@gnu.org
> http://mail.gnu.org/mailman/listinfo/guile-user
-- 
Regards,

Robert Marlow



_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-user


  reply	other threads:[~2003-07-24 15:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-24  7:48 Threads + pipes = bad? Robert Marlow
2003-07-24 15:07 ` Robert Marlow [this message]
2003-07-28 23:11   ` Kevin Ryde
2003-07-31  8:20     ` Robert Marlow

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1059059262.564.16.camel@zuul \
    --to=bobstopper@australispro.com.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).