|
Just the way it should be.
Question: How to use tasks?
Answer:
using (Task task = new Task(() => BackgroundMethod("The Task At Hand")))
{
task.Start();
task.Wait();
}
Double facepalm.
“Today is the first day of the rest of your life.”
|
|
|
|
|
I may be suspect to talk because I am participating in the competition... but I really believe in 2008 an article like that will be banned because, even if it is well written, it is not useful. Sure, it shows a lot of ways to create background threads. But, are they right?
Using BeginInvoke() and EndInvoke() just after makes the execution happen in a secondary thread, but it will be synchronous as the EndInvoke() will block.
As you just shown, using task.Start() and task.Wait() deserves a facepalm.
Using Parallel.Invoke() with a single delegate fits in the same category...
So, I think the article could deserve a 3 because it is well written, but it is not teaching anything. It is not showing the advantages of each approach or the problems that must be overcome... yet, it is simple... and apparently being simple is the only thing that matters now.
|
|
|
|
|
It saddens me that it's almost impossible to downvote articles: even if one is bold enough to comment on the vote (which is required for "3" or less), such votes are often disregarded as "Outside deviation limits - not included in the score". Just mouse over the stars in the most upvoted article and you'll see that only 4's and 5's matter. This is beyond stupid, in my opinion.
I can only hope that admins will take matters into their own hands and won't award a useless article. The note at the bottom mentions an "audition", whatever it is.
“Today is the first day of the rest of your life.”
|
|
|
|
|
I hope that too... but I am not really sure if the audition is to disallow an useless article as being the winner or if it is only to check if the users that voted are real users, not users created for a single vote.
Well... I am only sure that we will discover soon as the competition is about to end.
|
|
|
|
|
Apparently the audition worked in the reverse way.
The "Background Thread: Let's count the ways" was in first place as C# but in third place in the overall competition... yet, it won even on the overall competition.
I am very disappointed.
|
|
|
|
|
In the reverse way? Did voters of other articles cheat or what?
Is there any page which lists all winners in the monthly competition? Like, to congratulate and all? I only found Features > Competitions[^] page which is pretty hard to extract information from.
applejack-disappointed.jpg.to
“Today is the first day of the rest of your life.”
|
|
|
|
|
I really don't know what happened... but it is very strange in my opinion. To be honest, I don't care of losing the competition to the Peer to Peer File Sharing with WCF article, but to that other... well...
And about the winners, I usually only see them on an e-mail that codeproject sends... in fact, I know about the winners because it is presented directly in the article and I did check the articles directly.
|
|
|
|
|
Huh. Well, at least now I know what I need to write about to farm reputation.
“Today is the first day of the rest of your life.”
|
|
|
|
|
i love all C# article this month
Indonesia IT Intelijensi
Freedom of Revealing And Sharing Knowledge.
www.indonesiaitintelijensi.com
|
|
|
|