Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #12924

Re: [Windows] Any way to distinguish ^C Induced EOF from ^Z EOF?

From Robert Klemme <shortcutter@googlemail.com>
Newsgroups comp.lang.java.programmer
Subject Re: [Windows] Any way to distinguish ^C Induced EOF from ^Z EOF?
Date 2012-03-12 23:02 +0100
Message-ID <9s7a41F4a9U1@mid.individual.net> (permalink)
References (8 earlier) <jjli1s$ac7$1@news.albasani.net> <4f5e5780$0$282$14726298@news.sunsite.dk> <jjlm7u$kin$1@news.albasani.net> <4f5e61f3$0$281$14726298@news.sunsite.dk> <jjlqdt$uln$1@news.albasani.net>

Show all headers | View raw


On 03/12/2012 10:39 PM, Jan Burse wrote:
> Arne Vajhøj schrieb:
>> No but you ask users to enter it and complain
>> about its behavior.
>
> No, I only gave an example. The example does also
> go wrong on the Windows platform when you use (I
> tested it):
>
> cygwin
>
> And for example issue a kill from another process.
> Its deeply rooted in the behaviour of CON respectively
> CONIN$. And it is even documented by MS.

What do you expect then?  A signal handler is concurrent by design.  If 
the OS implementors chose to also automatically EOF the console the two 
cannot know from each other without introducing synchronization overhead 
just for this single case.  I doubt for any serious JVM implementor 
would trade off in this direction.

Plus, since there is concurrency involved there is not much guarantees 
cross platform anyway.  I also agree to Arne's position that it is 
unwise to commit on EOF and rollback otherwise: the more robust code is 
always to commit only when explicitly advised and rollback in all other 
cases.  Because only with explicit advice to commit you know the code 
behaved as intended.  But if a program crashes or dies otherwise (OOM 
for example) you cannot know whether all intended changes were applied.

So yes, the example is quite artificial (you also called it "naive" 
IIRC).  But what follows from bad code?

Cheers

	robert

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

[Windows] Any way to distinguish ^C Induced EOF from ^Z EOF? Jan Burse <janburse@fastmail.fm> - 2012-03-11 21:57 +0100
  Re: [Windows] Any way to distinguish ^C Induced EOF from ^Z EOF? Jan Burse <janburse@fastmail.fm> - 2012-03-11 22:10 +0100
  Re: [Windows] Any way to distinguish ^C Induced EOF from ^Z EOF? Arne Vajhøj <arne@vajhoej.dk> - 2012-03-11 17:28 -0400
    Re: [Windows] Any way to distinguish ^C Induced EOF from ^Z EOF? Jan Burse <janburse@fastmail.fm> - 2012-03-11 22:49 +0100
      Re: [Windows] Any way to distinguish ^C Induced EOF from ^Z EOF? Arne Vajhøj <arne@vajhoej.dk> - 2012-03-11 18:13 -0400
        Re: [Windows] Any way to distinguish ^C Induced EOF from ^Z EOF? Jan Burse <janburse@fastmail.fm> - 2012-03-11 23:23 +0100
          Re: [Windows] Any way to distinguish ^C Induced EOF from ^Z EOF? Arne Vajhøj <arne@vajhoej.dk> - 2012-03-11 18:35 -0400
          Re: [Windows] Any way to distinguish ^C Induced EOF from ^Z EOF? markspace <-@.> - 2012-03-11 15:51 -0700
            Re: [Windows] Any way to distinguish ^C Induced EOF from ^Z EOF? Jan Burse <janburse@fastmail.fm> - 2012-03-12 10:58 +0100
              Re: [Windows] Any way to distinguish ^C Induced EOF from ^Z EOF? Lew <noone@lewscanon.com> - 2012-03-12 07:38 -0700
                Re: [Windows] Any way to distinguish ^C Induced EOF from ^Z EOF? Jan Burse <janburse@fastmail.fm> - 2012-03-12 20:43 +0100
                Re: [Windows] Any way to distinguish ^C Induced EOF from ^Z EOF? Arne Vajhøj <arne@vajhoej.dk> - 2012-03-12 16:01 -0400
                Re: [Windows] Any way to distinguish ^C Induced EOF from ^Z EOF? Joshua Cranmer <Pidgeot18@verizon.invalid> - 2012-03-12 17:28 -0500
                Re: [Windows] Any way to distinguish ^C Induced EOF from ^Z EOF? Jan Burse <janburse@fastmail.fm> - 2012-03-13 00:33 +0100
                Re: [Windows] Any way to distinguish ^C Induced EOF from ^Z EOF? Lew <lewbloch@gmail.com> - 2012-03-12 16:50 -0700
                Re: [Windows] Any way to distinguish ^C Induced EOF from ^Z EOF? Jan Burse <janburse@fastmail.fm> - 2012-03-13 00:56 +0100
                Re: [Windows] Any way to distinguish ^C Induced EOF from ^Z EOF? Arne Vajhøj <arne@vajhoej.dk> - 2012-03-12 20:03 -0400
                Re: [Windows] Any way to distinguish ^C Induced EOF from ^Z EOF? Jan Burse <janburse@fastmail.fm> - 2012-03-13 01:05 +0100
                Re: [Windows] Any way to distinguish ^C Induced EOF from ^Z EOF? Arne Vajhøj <arne@vajhoej.dk> - 2012-03-12 20:53 -0400
                Re: [Windows] Any way to distinguish ^C Induced EOF from ^Z EOF? Jan Burse <janburse@fastmail.fm> - 2012-03-13 14:06 +0100
                Re: [Windows] Any way to distinguish ^C Induced EOF from ^Z EOF? Jan Burse <janburse@fastmail.fm> - 2012-03-13 14:13 +0100
                Re: [Windows] Any way to distinguish ^C Induced EOF from ^Z EOF? Arne Vajhøj <arne@vajhoej.dk> - 2012-03-13 11:36 -0400
                Re: [Windows] Any way to distinguish ^C Induced EOF from ^Z EOF? Jan Burse <janburse@fastmail.fm> - 2012-03-13 17:48 +0100
                Re: [Windows] Any way to distinguish ^C Induced EOF from ^Z EOF? Jan Burse <janburse@fastmail.fm> - 2012-03-13 17:51 +0100
                Re: [Windows] Any way to distinguish ^C Induced EOF from ^Z EOF? Arne Vajhøj <arne@vajhoej.dk> - 2012-03-13 13:06 -0400
                Re: [Windows] Any way to distinguish ^C Induced EOF from ^Z EOF? Arne Vajhøj <arne@vajhoej.dk> - 2012-03-12 19:56 -0400
                Re: [Windows] Any way to distinguish ^C Induced EOF from ^Z EOF? Jan Burse <janburse@fastmail.fm> - 2012-03-13 01:05 +0100
                Re: [Windows] Any way to distinguish ^C Induced EOF from ^Z EOF? Lew <lewbloch@gmail.com> - 2012-03-12 17:23 -0700
                Re: [Windows] Any way to distinguish ^C Induced EOF from ^Z EOF? Arne Vajhøj <arne@vajhoej.dk> - 2012-03-12 20:51 -0400
                Re: [Windows] Any way to distinguish ^C Induced EOF from ^Z EOF? Martin Gregorie <martin@address-in-sig.invalid> - 2012-03-13 02:33 +0000
                Re: [Windows] Any way to distinguish ^C Induced EOF from ^Z EOF? Patricia Shanahan <pats@acm.org> - 2012-03-12 20:39 -0700
                Re: [Windows] Any way to distinguish ^C Induced EOF from ^Z EOF? Jan Burse <janburse@fastmail.fm> - 2012-03-13 14:17 +0100
                Re: [Windows] Any way to distinguish ^C Induced EOF from ^Z EOF? Arne Vajhøj <arne@vajhoej.dk> - 2012-03-13 11:38 -0400
                Re: [Windows] Any way to distinguish ^C Induced EOF from ^Z EOF? Joshua Cranmer <Pidgeot18@verizon.invalid> - 2012-03-12 21:59 -0500
                Re: [Windows] Any way to distinguish ^C Induced EOF from ^Z EOF? Jan Burse <janburse@fastmail.fm> - 2012-03-13 14:20 +0100
                Re: [Windows] Any way to distinguish ^C Induced EOF from ^Z EOF? Arne Vajhøj <arne@vajhoej.dk> - 2012-03-13 11:28 -0400
                Re: [Windows] Any way to distinguish ^C Induced EOF from ^Z EOF? Jan Burse <janburse@fastmail.fm> - 2012-03-13 17:42 +0100
                Re: [Windows] Any way to distinguish ^C Induced EOF from ^Z EOF? Arne Vajhøj <arne@vajhoej.dk> - 2012-03-13 13:16 -0400
                Re: [Windows] Any way to distinguish ^C Induced EOF from ^Z EOF? Jan Burse <janburse@fastmail.fm> - 2012-03-13 18:17 +0100
                Re: [Windows] Any way to distinguish ^C Induced EOF from ^Z EOF? Jan Burse <janburse@fastmail.fm> - 2012-03-13 18:19 +0100
              Re: [Windows] Any way to distinguish ^C Induced EOF from ^Z EOF? Silvio Bierman <silvio@moc.com> - 2012-03-12 16:21 +0100
                Re: [Windows] Any way to distinguish ^C Induced EOF from ^Z EOF? Jan Burse <janburse@fastmail.fm> - 2012-03-12 20:35 +0100
                Re: [Windows] Any way to distinguish ^C Induced EOF from ^Z EOF? Robert Klemme <shortcutter@googlemail.com> - 2012-03-12 22:49 +0100
                Re: [Windows] Any way to distinguish ^C Induced EOF from ^Z EOF? Silvio Bierman <silvio@moc.com> - 2012-03-13 14:10 +0100
              Re: [Windows] Any way to distinguish ^C Induced EOF from ^Z EOF? Arne Vajhøj <arne@vajhoej.dk> - 2012-03-12 13:49 -0400
                Re: [Windows] Any way to distinguish ^C Induced EOF from ^Z EOF? Jan Burse <janburse@fastmail.fm> - 2012-03-12 20:16 +0100
                Re: [Windows] Any way to distinguish ^C Induced EOF from ^Z EOF? Leif Roar Moldskred <leifm@dimnakorr.com> - 2012-03-12 14:42 -0500
                Re: [Windows] Any way to distinguish ^C Induced EOF from ^Z EOF? Jan Burse <janburse@fastmail.fm> - 2012-03-12 20:46 +0100
                Re: [Windows] Any way to distinguish ^C Induced EOF from ^Z EOF? Arne Vajhøj <arne@vajhoej.dk> - 2012-03-12 16:09 -0400
                Re: [Windows] Any way to distinguish ^C Induced EOF from ^Z EOF? Arne Vajhøj <arne@vajhoej.dk> - 2012-03-12 16:07 -0400
                Re: [Windows] Any way to distinguish ^C Induced EOF from ^Z EOF? Jan Burse <janburse@fastmail.fm> - 2012-03-12 21:27 +0100
                Re: [Windows] Any way to distinguish ^C Induced EOF from ^Z EOF? Arne Vajhøj <arne@vajhoej.dk> - 2012-03-12 16:52 -0400
                Re: [Windows] Any way to distinguish ^C Induced EOF from ^Z EOF? Jan Burse <janburse@fastmail.fm> - 2012-03-12 22:39 +0100
                Re: [Windows] Any way to distinguish ^C Induced EOF from ^Z EOF? Arne Vajhøj <arne@vajhoej.dk> - 2012-03-12 17:56 -0400
                Re: [Windows] Any way to distinguish ^C Induced EOF from ^Z EOF? Robert Klemme <shortcutter@googlemail.com> - 2012-03-12 23:02 +0100
                Re: [Windows] Any way to distinguish ^C Induced EOF from ^Z EOF? Jan Burse <janburse@fastmail.fm> - 2012-03-13 00:18 +0100
                Re: [Windows] Any way to distinguish ^C Induced EOF from ^Z EOF? Jan Burse <janburse@fastmail.fm> - 2012-03-13 00:19 +0100
  Re: [Windows] Any way to distinguish ^C Induced EOF from ^Z EOF? Steven Simpson <ss@domain.invalid> - 2012-03-13 10:28 +0000
    Re: [Windows] Any way to distinguish ^C Induced EOF from ^Z EOF? Jan Burse <janburse@fastmail.fm> - 2012-03-13 14:11 +0100
      Re: [Windows] Any way to distinguish ^C Induced EOF from ^Z EOF? Arne Vajhøj <arne@vajhoej.dk> - 2012-03-13 11:41 -0400
        Re: [Windows] Any way to distinguish ^C Induced EOF from ^Z EOF? Jan Burse <janburse@fastmail.fm> - 2012-03-13 17:43 +0100
          Re: [Windows] Any way to distinguish ^C Induced EOF from ^Z EOF? Arne Vajhøj <arne@vajhoej.dk> - 2012-03-13 13:03 -0400
            Re: [Windows] Any way to distinguish ^C Induced EOF from ^Z EOF? Jan Burse <janburse@fastmail.fm> - 2012-03-13 18:20 +0100
              Re: [Windows] Any way to distinguish ^C Induced EOF from ^Z EOF? Arne Vajhøj <arne@vajhoej.dk> - 2012-03-13 13:36 -0400
              Re: [Windows] Any way to distinguish ^C Induced EOF from ^Z EOF? Leif Roar Moldskred <leifm@dimnakorr.com> - 2012-03-13 12:42 -0500
                Re: [Windows] Any way to distinguish ^C Induced EOF from ^Z EOF? Jan Burse <janburse@fastmail.fm> - 2012-03-13 18:51 +0100
                Re: [Windows] Any way to distinguish ^C Induced EOF from ^Z EOF? Jan Burse <janburse@fastmail.fm> - 2012-03-13 18:51 +0100
                Re: [Windows] Any way to distinguish ^C Induced EOF from ^Z EOF? Arne Vajhøj <arne@vajhoej.dk> - 2012-03-13 19:53 -0400
                Re: [Windows] Any way to distinguish ^C Induced EOF from ^Z EOF? Jan Burse <janburse@fastmail.fm> - 2012-03-14 01:21 +0100
      Re: [Windows] Any way to distinguish ^C Induced EOF from ^Z EOF? Steven Simpson <ss@domain.invalid> - 2012-03-13 17:26 +0000
        Re: [Windows] Any way to distinguish ^C Induced EOF from ^Z EOF? Jan Burse <janburse@fastmail.fm> - 2012-03-13 18:44 +0100

csiph-web