Forum Controls
Spotlight Features

The Rich Engineering Heritage Behind Dependency Injection

Andrew McVeigh takes us on a tour of the rich heritage behind dependency injection, what it represents, and tells us why its here to stay.

NetBeans 6: Matisse Updates

NetBeans 6 delivers great updates to the Matisse GUI builder. Spend a few minutes with Roman Strobl and get an expert briefing on what's new and what has changed.

Introduction to Groovy Part 3

In this, the third and final installation of Andres' Introduction to Groovy series, you learn about how Groovy handles variable numbers of arguments, named parameters, currying, and more about Groovy operators. Including, some new operators.

Easier Custom Components with Swing Fuse

Swing Fuse (actually just Fuse), is a framework designed to make it easier to create your own custom desktop components. In this article, Daniel Spiewak shows you how to get started and provides sample source code you can download.

Benchmark Analysis: Guice vs Spring

Willam Louth shows how he uses JXInsight Probes to investigate probable performance issues with code bases that he is not familiar with. He also highlights possible pitfalls in creating a benchmark, as well as in the analysis of results.
Replies: 7 - Pages: 1  
Threads: [ Previous | Next ]
  Click to reply to this thread Reply

A referee in concurrent question is wanted :)

At 3:39 AM on May 17, 2007, Evgeniy Platonov wrote:

Hi there :)
In the context of SM6 I've found the following question http://www.javablackbelt.com/QuestionDetail.wwa?qidk=11714 (although it doesn't fit to SM6 criteria ) ).
I beleive that the question has WRONG answer. I've tested the code from the question on 2 different PCs, and the result wasn't the same as in the question. I had created new proposition there, but Pravin Jain has rejected it.
Can someone be a referee?
Thanks.

p.s. You can find my proposition as revision #3 (rejected)
1 . At 9:10 AM on May 17, 2007, Henryk Konsek wrote:
  Click to reply to this thread Reply

Re: A referee in concurrent question is wanted :)

I agrre with you Evgeniy. I posted similar comment to this questions some time ago. It also was rejected.
http://jheniu.blogspot.com http://www.javablackbelt.com/UserView.wwa?userId=3523423
2 . At 8:49 PM on May 17, 2007, Chinh Nguyen wrote:
  Click to reply to this thread Reply

Re: A referee in concurrent question is wanted :)

Hmm I think option #4 is more likely to be the answer. And I suppose the explanation also says that the answer is option #4 too.
Brown Belt #1450799
3 . At 4:29 AM on May 18, 2007, Alwin Ibba DeveloperZone Top 100 wrote:
  Click to reply to this thread Reply

Re: A referee in concurrent question is wanted :)

You are right, Evgeniy. First, the explanation of the question is not consistent with the answer, choice 4 should be the correct one according to Pravins explanation. Second, Java makes no guarantees at all about scheduling or that a thread is started at all. Most JVMs would behave in a way so that the output of choice 4 is printed to the console. So your version of the question including your explanation is correct.
4 . At 10:05 AM on May 18, 2007, Evgeniy Platonov wrote:
  Click to reply to this thread Reply

Re: A referee in concurrent question is wanted :)

Thanks guys :) I see I'm not wrong (a lot of comments in the question also proves it).
And the next question: how can we convince Pravin of the thruth of our words?
I think administrators should help us there, shouldn't they?
http://www.javablackbelt.com/UserView.wwa?userId=3512464
5 . At 1:55 PM on May 18, 2007, Jeanne Boyarsky DeveloperZone Top 100 wrote:
  Click to reply to this thread Reply

Re: A referee in concurrent question is wanted :)

I've moved the question to the freezer until this is resolved. I agree with the posts in this thread that the answer cannot be determined. I've added a comment to the author to discuss here.
6 . At 10:47 PM on May 18, 2007, Pravin Jain wrote:
  Click to reply to this thread Reply

Re: A referee in concurrent question is wanted :)

I have updated the question.
pl. check the changed version.
7 . At 5:00 AM on May 19, 2007, Alwin Ibba DeveloperZone Top 100 wrote:
  Click to reply to this thread Reply

Re: A referee in concurrent question is wanted :)

Your update misses the point. There's no guarantee that a thread is started when you call start(). A VM can do anything as long as it does not break the rules described in chapter 17 of JLS third edition. The scheduler may choose to delay the execution of thread1 for x seconds for whatever reason. It doesn't matter if there are processes hogging one or more CPUs. The point is that a specific behaviour is not guaranteed. BTW, your question still marks choice 2 as the correct one. Please try your code and I bet you will get the output of choice 4. But this doesn't really matter since even choice 4 is not guaranteed the result is unpredictable.

thread.rss_message