Calling a lambda expression from a new thread before the main method is run causes the thread to lock up

2017-01-23 Thread Luke Hutchison
If you run the code below, the active JVM thread (in the ExecutorService) locks up when the lambda expression is called. The Eclipse debugger is not able to stop the locked-up thread, or get a stacktrace beyond the call into the lambda. The problem seems to be that some part of the Java 8 lambda s

Re: Calling a lambda expression from a new thread before the main method is run causes the thread to lock up

2017-01-23 Thread David Holmes
Hi Luke, On 24/01/2017 2:41 PM, Luke Hutchison wrote: If you run the code below, the active JVM thread (in the ExecutorService) locks up when the lambda expression is called. The Eclipse debugger is not able to stop the locked-up thread, or get a stacktrace beyond the call into the lambda. Tha

Re: Calling a lambda expression from a new thread before the main method is run causes the thread to lock up

2017-01-23 Thread Luke Hutchison
On Mon, Jan 23, 2017 at 10:48 PM, David Holmes wrote: > On 24/01/2017 2:41 PM, Luke Hutchison wrote: > >> If you run the code below, the active JVM thread (in the ExecutorService) >> locks up when the lambda expression is called. The Eclipse debugger is not >> able to stop the locked-up thread, o

Re: Calling a lambda expression from a new thread before the main method is run causes the thread to lock up

2017-01-23 Thread Luke Hutchison
On Mon, Jan 23, 2017 at 11:21 PM, Luke Hutchison wrote: > That looks like a variation of the classic class initialization deadlock >> problem. Your main thread is blocked in es.submit(callable).get(); while >> still within the static initializer of the LambdaBug class. If the executor >> thread a

Re: Calling a lambda expression from a new thread before the main method is run causes the thread to lock up

2017-01-23 Thread Luke Hutchison
On Mon, Jan 23, 2017 at 11:37 PM, Luke Hutchison wrote: > On Mon, Jan 23, 2017 at 11:21 PM, Luke Hutchison > wrote: > >> That looks like a variation of the classic class initialization deadlock >>> problem. Your main thread is blocked in es.submit(callable).get(); while >>> still within the stat

Re: Calling a lambda expression from a new thread before the main method is run causes the thread to lock up

2017-01-24 Thread Remi Forax
- Mail original - > De: "Luke Hutchison" > À: "David Holmes" > Cc: core-libs-dev@openjdk.java.net > Envoyé: Mardi 24 Janvier 2017 08:21:39 > Objet: Re: Calling a lambda expression from a new thread before the main > method is run causes the thr

Re: Calling a lambda expression from a new thread before the main method is run causes the thread to lock up

2017-01-24 Thread Luke Hutchison
On Tue, Jan 24, 2017 at 12:02 AM, Remi Forax wrote: > a worker thread of the executor will try to execute the code of the static > method but because the static initializer is not finished, the worker > thread has to wait But what is the worker thread waiting for in the case of the lambda that

Re: Calling a lambda expression from a new thread before the main method is run causes the thread to lock up

2017-01-24 Thread forax
> De: "Luke Hutchison" > À: "Remi Forax" > Cc: "David Holmes" , core-libs-dev@openjdk.java.net > Envoyé: Mardi 24 Janvier 2017 09:13:17 > Objet: Re: Calling a lambda expression from a new thread before the main > method > is run causes the th

Re: Calling a lambda expression from a new thread before the main method is run causes the thread to lock up

2017-01-24 Thread David Holmes
On 24/01/2017 5:21 PM, Luke Hutchison wrote: On Mon, Jan 23, 2017 at 10:48 PM, David Holmes mailto:david.hol...@oracle.com>> wrote: On 24/01/2017 2:41 PM, Luke Hutchison wrote: If you run the code below, the active JVM thread (in the ExecutorService) locks up when th

Re: Calling a lambda expression from a new thread before the main method is run causes the thread to lock up

2017-01-24 Thread David Holmes
es" , core-libs-dev@openjdk.java.net *Envoyé: *Mardi 24 Janvier 2017 09:13:17 *Objet: *Re: Calling a lambda expression from a new thread before the main method is run causes the thread to lock up On Tue, Jan 24, 2017 at 12:02 AM, Remi Forax mailto:fo...@univ-mlv.fr>> wrote

Re: Calling a lambda expression from a new thread before the main method is run causes the thread to lock up

2017-01-24 Thread Luke Hutchison
Thank you Remi and David for your detailed explanations, this was very helpful, and I understand the issues now. Please go ahead and close the Jira bug I created for this (JDK-8173252), I see this is WAI. On Tue, Jan 24, 2017 at 12:39 AM, wrote: > Here is your code slightly modified, with no lam