|
View:
New views
12 Messages
—
Rating Filter:
Alert me
|
| < Prev | 1 - 2 | Next > |
|
|
Re: future hangsMMmmm. Cool stuff. I considered the other day making a getoptions class, but this is far better!
On Wed, Jul 8, 2009 at 10:07 AM, Josh Suereth <joshua.suereth@...> wrote:
-- Daniel C. Sobral Something I learned in academia: there are three kinds of academic reviews: review by name, review by reference and review by value. |
|
|
Re: future hangsTyping Ctrl-Break in the console window where you invoked the JVM from
gives you a dump of all thread stacks, including what objects each locks. It often detects deadlocks and explicitly points them out. Thus a deadlock 'tells you' exactly what went wrong and where too. If you can't type Ctrl-Break because you're in an IDE, send the process the QUIT signal (no, this does not kill the process), e.g., kill -QUIT 12345. If you can't send the process the QUIT signal because you're on the wrong OS, there's a button in the Run window to do it in IDEA. There isn't in Netbeans or Eclipse. Why are you using those IDEs again? 2009/7/8 Naftoli Gugenhem <naftoligug@...>: > I'm not sure what you mean by unrecoverable. You can catch an exception -- but if you're smart enough to think about catching it you know that you're causing it in the first place. (Although if the exception is caught by an outer code block that's agnostic of your erroneous implementation then you have to some extent recovered.) > In any case, who wouldn't prefer a terminating exception to a hanging deadlock? An exception tells you exactly what went wrong and where it went wrong. > Although if it's slow, like you say, then I agree that it may be too much of a price to pay to save the unwise from mysterious hangs... > > ------------------------------------- > Jim Andreou<jim.andreou@...> wrote: > > That check would (slowly, did I mention?) transform a deadlock to an > exception - but both are unrecoverable conditions which require stopping and > fixing the code anyway. > 2009/7/8 Naftoli Gugenhem <naftoligug@...> > >> So the safety is not worth the "ugliness" for thread-based utilities such >> as future to check for it? As someone pointed out, such bugs can come even >> without Application. >> (I'm suggesting the check for the library, not for user code. Also, I >> suppose someone might be able to put such a check for these methods in an >> aspect...) >> ------------------------------------- >> Jim Andreou<jim.andreou@...> wrote: >> >> Yeah, but it's ultra ugly. Search for a <clinit> method in the stack trace. >> Then sue yourself for doing it. >> 2009/7/8 Naftoli Gugenhem <naftoligug@...> >> >> > Is there any way to detect if code is running in a static initialization? >> > >> > ------------------------------------- >> > Christos KK Loverdos<loverdos@...> wrote: >> > >> > lol >> > >> > [Incidentally, I have just returned from a trip to Sparta :-) .] >> > >> > >> > On Jul 8, 2009, at 4:12 PM, Jim Andreou wrote: >> > >> > > +300 >> > > >> > > - This is blasphemy! This is madness! >> > > - This is Scalta! >> > > >> > > 2009/7/8 Josh Suereth <joshua.suereth@...> >> > > >> > > >> > > On Wed, Jul 8, 2009 at 9:03 AM, Viktor Klang >> > > <viktor.klang@...> wrote: >> > > Remove Application in 2.8? >> > > >> > > +30 >> > > >> > > Although, I'd rather see it replaced by something like David >> > > MacIver's "Optional" library: >> > http://github.com/DRMacIver/optional/tree/master >> > > >> > > - Josh >> > > >> > >> > -- >> > __~O >> > -\ <, Christos KK Loverdos >> > (*)/ (*) http://ckkloverdos.com >> > >> > >> > >> > >> > >> > >> > -- Ricky Clarkson Java Programmer, AD Holdings +44 1565 770804 Skype: ricky_clarkson Google Talk: ricky.clarkson@... |
|
|
Re: future hangs+1
On Wed, Jul 8, 2009 at 9:03 AM, Viktor Klang <viktor.klang@...> wrote: Remove Application in 2.8? -- http://erikengbrecht.blogspot.com/ |
|
|
|
|
|
Re: future hangsOn Wednesday July 8 2009, Naftoli Gugenhem wrote:
> Good to know. How does this IDEA command work on Windows? Do you see the little camera icon in the Run window? It's there in the Linux version and the documentation (on-line help) doesn't mention that it's a Linux-only thing. Randall Schulz > ------------------------------------- > Ricky Clarkson<ricky.clarkson@...> wrote: > > Typing Ctrl-Break in the console window where you invoked the JVM > from gives you a dump of all thread stacks, including what objects > each locks. It often detects deadlocks and explicitly points them > out. Thus a deadlock 'tells you' exactly what went wrong and where > too. > > If you can't type Ctrl-Break because you're in an IDE, send the > process the QUIT signal (no, this does not kill the process), e.g., > kill -QUIT 12345. > > If you can't send the process the QUIT signal because you're on the > wrong OS, there's a button in the Run window to do it in IDEA. There > isn't in Netbeans or Eclipse. Why are you using those IDEs again? > > ... |
|
|
|
|
|
Re: future hangsOn Wed, Jul 08, 2009 at 03:31:17PM -0700, Naftoli Gugenhem said
> I don't have IDEA. What I meant to ask is, I thought Windows doesn't have the linux concept of signals, so how does it simulate Ctrl-Break? If I remember correctly at the windows command line pressing CTRL-Break dumps the JVM information. In most cases sending the QUIT signal to a program in unix to get that information is done by pressing CTRL-\ at its controlling terminal. -- Geoff Reedy |
|
|
Re: future hangsNaftoli Gugenhem wrote:
> I don't have IDEA. What I meant to ask is, I thought Windows doesn't have the linux concept of signals, so how does it simulate Ctrl-Break? I think Windows does have something similar to Linux signals. Ctrl-Break does get translated by CMD into some sort of signal sent to the current process, so I would imagine that IDEA can send the same signal. I remember seeing C code in one of the projects at work which handled the Ctrl-Break signal. Ciao, Gordon |
|
|
Re: future hangsIn case it's useful to anyone, one can just fire jconsole up, choose the process to connect, go to "threads" tab and click "deadlock detection" (but even merely peeking what each thread is doing is interesting too)
2009/7/9 Gordon Tyler <gordon@...>
|
|
|
Re: future hangsOn Thu, Jul 9, 2009 at 12:54 AM, Gordon Tyler<gordon@...> wrote:
> I think Windows does have something similar to Linux signals. Ctrl-Break > does get translated by CMD into some sort of signal sent to the current > process, so I would imagine that IDEA can send the same signal. FYI: See https://openjdk.dev.java.net/source/browse/openjdk/jdk/trunk/hotspot/src/os/windows/vm/os_windows.cpp?rev=257&view=markup for the OpenJDK Windows implementation of signals. You can register a SetConsoleCtrlHandler to handle console events. Hotspot registers a handler (consoleHandler) and simulates fine grained signals based on this. Johannes ----------------------------------------------- Johannes Rudolph http://virtual-void.net |
|
|
Re: future hangsIt appears to insert its own code as a thread in your program, because
triggerCtrlBreak in some IDEA-specific class is present in the thread dump. I heard that that's a native method but haven't looked into it. 2009/7/8 Naftoli Gugenhem <naftoligug@...>: > I don't have IDEA. What I meant to ask is, I thought Windows doesn't have the linux concept of signals, so how does it simulate Ctrl-Break? > > ------------------------------------- > Randall R Schulz<rschulz@...> wrote: > > On Wednesday July 8 2009, Naftoli Gugenhem wrote: >> Good to know. How does this IDEA command work on Windows? > > Do you see the little camera icon in the Run window? It's there in the > Linux version and the documentation (on-line help) doesn't mention that > it's a Linux-only thing. > > > Randall Schulz > > >> ------------------------------------- >> Ricky Clarkson<ricky.clarkson@...> wrote: >> >> Typing Ctrl-Break in the console window where you invoked the JVM >> from gives you a dump of all thread stacks, including what objects >> each locks. It often detects deadlocks and explicitly points them >> out. Thus a deadlock 'tells you' exactly what went wrong and where >> too. >> >> If you can't type Ctrl-Break because you're in an IDE, send the >> process the QUIT signal (no, this does not kill the process), e.g., >> kill -QUIT 12345. >> >> If you can't send the process the QUIT signal because you're on the >> wrong OS, there's a button in the Run window to do it in IDEA. There >> isn't in Netbeans or Eclipse. Why are you using those IDEs again? >> >> ... > -- Ricky Clarkson Java Programmer, AD Holdings +44 1565 770804 Skype: ricky_clarkson Google Talk: ricky.clarkson@... |
|
|
Re: future hangsYou can use jstack from the JDK to get you the thread dump.
Cormac
|
| < Prev | 1 - 2 | Next > |
| Free embeddable forum powered by Nabble | Forum Help |