9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Axel Belinfante <Axel.Belinfante@cs.utwente.nl>
To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu>
Subject: Re: [9fans] thread confusion
Date: Wed, 21 Sep 2005 16:32:13 +0200	[thread overview]
Message-ID: <200509211432.j8LEWEX00091@zamenhof.cs.utwente.nl> (raw)
In-Reply-To: Your message of "Wed, 21 Sep 2005 15:53:51 +0200." <6aec7d5cd5d9af853b090abafcff13a4@lsub.org>

> :  A/The main weird thing is that after doing threadint on a thread
> :  (created with proccreate) which presumably is hanging in a read
> :  sometimes(?) the process just disappears without leaving a trace,
> :  even though it is packed with syslog calls
> :  (of which only the first part gets executed).
> 
> Did you call threadnotify()?

No, threadint() (see below)

> Put a print there (the handler) to see what's going on.
lots of syslog already (instead of print - does that matter?)

> Also, forwarding advice Russ gave time before :-), read the alef paper
> and don't use interrupts at all.

Agreed. I tried to do that (not use interrupts).

The problem is that in this particular thread/proc I call
library routine tlsClient which may hang in a read from a pipe
of which I am holding the other end (to tunnel the messages).
It may happen that 'the other end' decides to give up
on a TLS handshake in progress and start a new TLS handshake,
in which case I have to 'clean up' my side of the handshake
in progress.
This is where sometimes things go wrong:
it seems that just closing my end of the pipe
is not sufficient to get tlsClient out of the read.

That's why I tried to resort to threadint:
	"Threadint interrupts a thread that is blocked
	 in a channel operation or system call"
(although now the question is what it means to be interrupted)

Probably I should instead investigate how/why closing
(my end of) the pipe is not sufficient.

Would not be surprised if I'm making mistake that's
so trivial/basic that I'm just overlooking it :-(

(in the mean time my piece of code/administration to
 deal with all this is starting to live a life of its
 own so just getting it right and simple would be good.
 back to the drawing board, I guess...)

Axel.




  reply	other threads:[~2005-09-21 14:32 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-21 13:53 Fco. J. Ballesteros
2005-09-21 14:32 ` Axel Belinfante [this message]
  -- strict thread matches above, loose matches on Subject: below --
2005-09-21 15:48 Fco. J. Ballesteros
2005-09-21 14:44 Fco. J. Ballesteros
2005-09-21 15:05 ` Axel Belinfante
2005-09-21 15:42   ` Russ Cox
2005-09-21 20:25     ` Axel Belinfante
2005-09-21 20:32       ` Axel Belinfante
2005-09-21 20:37       ` Russ Cox
2005-09-21 22:34         ` Axel Belinfante
2005-09-21 22:44           ` Russ Cox
2005-09-26 18:40       ` rog
2005-09-26 18:52         ` Russ Cox
2005-09-26 19:20           ` rog
2005-09-27 10:12         ` Axel Belinfante
2005-09-21 13:25 Axel Belinfante

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

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

  git send-email \
    --in-reply-to=200509211432.j8LEWEX00091@zamenhof.cs.utwente.nl \
    --to=axel.belinfante@cs.utwente.nl \
    --cc=9fans@cse.psu.edu \
    /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 NNTP newsgroup(s).