public inbox for java@gcc.gnu.org
 help / color / mirror / Atom feed
From: Godmar Back <gback@cs.utah.edu>
To: bryce@albatross.co.nz (Bryce McKinlay)
Cc: jsturm@sigma6.com (Jeff Sturm), krab@eos.dk (Kresten Krab Thorup),
	java-discuss@sourceware.cygnus.com
Subject: Re: Thread.interrupt()
Date: Sat, 01 Apr 2000 00:00:00 -0000	[thread overview]
Message-ID: <200003150009.RAA22643@faith.cs.utah.edu> (raw)
Message-ID: <20000401000000.OuRaqw3OCck8XhJorvsyfKfQkAhdiB19AiaBgUF1Hxg@z> (raw)
In-Reply-To: <38CEBB1B.F3BAD00E@albatross.co.nz>

> 
> Jeff Sturm wrote:
> 
> > IOW, Sun crippled their API because Win32 doesn't handle interruptable
> > I/O portably.  Not a good policy.
> >
> > Since Java doesn't support read() with timeouts either, it is easy to
> > create a "stuck" thread that can never die.
> 
> Well, according to the JDK 1.2 API docs, it does for socket reads. We don't
> implement this properly yet, though.
> 
> public void setSoTimeout(int timeout)
>                   throws SocketException
> 

I implemented both InterruptedIOException and the socket timeout stuff
in Kaffe a while ago.  You could use SoInterrupt.java and SoTimeout.java
from the regression directory if you need test cases.

I tend to agree with Lea's (or whoever's) argument that a meaningful 
continuation after an interrupted I/O is rarely possible.  IIRC, the
argument he gave was that the interruption will often occur deep inside
a layered hierarchy of BufferReader/StreamReader/Reader etc. which cannot
deal with interrupted I/O.  One issue is that you may end up with 
partial reads/writes after an interruption, which need to be dealt with.
In other words, the buffer classes would have to be interruption-aware
and "restartable".   Otherwise, data may be sent or received twice.
Granted, these classes could be fixed, but at a higher cost in 
implementation complexity.  For this reason, I think that the more 
pragmatic "close-the-socket" approach may be preferable.

	- Godmar

  reply	other threads:[~2000-04-01  0:00 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-04-01  0:00 Thread.interrupt() Bryce McKinlay
2000-03-13 13:33 ` Thread.interrupt() Bryce McKinlay
2000-03-14  2:24   ` Thread.interrupt() Kresten Krab Thorup
2000-03-14  3:26     ` Thread.interrupt() Bryce McKinlay
2000-04-01  0:00       ` Thread.interrupt() Bryce McKinlay
2000-03-14  5:52     ` Thread.interrupt() Jeff Sturm
2000-03-14 11:02       ` Thread.interrupt() Tom Tromey
2000-04-01  0:00         ` Thread.interrupt() Tom Tromey
2000-03-14 14:16       ` Thread.interrupt() Bryce McKinlay
2000-03-14 16:09         ` Godmar Back [this message]
2000-04-01  0:00           ` Thread.interrupt() Godmar Back
2000-04-01  0:00         ` Thread.interrupt() Bryce McKinlay
2000-04-01  0:00       ` Thread.interrupt() Jeff Sturm
2000-04-01  0:00     ` Thread.interrupt() Kresten Krab Thorup
2000-04-01  0:00   ` Thread.interrupt() Bryce McKinlay
  -- strict thread matches above, loose matches on Subject: below --
2000-03-16  4:08 Thread.interrupt() Miles Sabin
2000-04-01  0:00 ` Thread.interrupt() Miles Sabin
2000-03-15 13:52 Thread.interrupt() Boehm, Hans
2000-04-01  0:00 ` Thread.interrupt() Boehm, Hans
2000-03-15 13:06 Thread.interrupt() Miles Sabin
2000-04-01  0:00 ` Thread.interrupt() Miles Sabin
2000-03-15 12:55 Thread.interrupt() Boehm, Hans
2000-04-01  0:00 ` Thread.interrupt() Boehm, Hans
2000-03-15 11:57 Thread.interrupt() Miles Sabin
2000-04-01  0:00 ` Thread.interrupt() Miles Sabin
2000-03-15 11:38 Thread.interrupt() Boehm, Hans
2000-04-01  0:00 ` Thread.interrupt() Boehm, Hans
2000-03-15  5:51 Thread.interrupt() Miles Sabin
2000-04-01  0:00 ` Thread.interrupt() Miles Sabin
2000-03-14 16:30 Thread.interrupt() Boehm, Hans
2000-03-14 17:17 ` Thread.interrupt() Jesper Peterson
2000-03-14 17:27   ` Thread.interrupt() Tom Tromey
2000-04-01  0:00     ` Thread.interrupt() Tom Tromey
2000-04-01  0:00   ` Thread.interrupt() Jesper Peterson
2000-04-01  0:00 ` Thread.interrupt() Boehm, Hans
2000-03-14 11:26 Thread.interrupt() Boehm, Hans
2000-04-01  0:00 ` Thread.interrupt() Boehm, Hans
2000-03-14  9:57 Thread.interrupt() Boehm, Hans
2000-03-14 10:52 ` Thread.interrupt() Tom Tromey
2000-04-01  0:00   ` Thread.interrupt() Tom Tromey
2000-03-14 15:59 ` Thread.interrupt() Jesper Peterson
2000-04-01  0:00   ` Thread.interrupt() Jesper Peterson
2000-04-01  0:00 ` Thread.interrupt() Boehm, Hans
2000-03-14  7:47 Thread.interrupt() Miles Sabin
2000-04-01  0:00 ` Thread.interrupt() Miles Sabin
2000-03-14  6:00 Thread.interrupt() Miles Sabin
2000-03-14  7:36 ` Thread.interrupt() Jeff Sturm
2000-03-14 10:58   ` Thread.interrupt() Tom Tromey
2000-04-01  0:00     ` Thread.interrupt() Tom Tromey
2000-04-01  0:00   ` Thread.interrupt() Jeff Sturm
2000-04-01  0:00 ` Thread.interrupt() Miles Sabin

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=200003150009.RAA22643@faith.cs.utah.edu \
    --to=gback@cs.utah.edu \
    --cc=bryce@albatross.co.nz \
    --cc=java-discuss@sourceware.cygnus.com \
    --cc=jsturm@sigma6.com \
    --cc=krab@eos.dk \
    /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).