Click here to Skip to main content
11,921,479 members (61,844 online)
Rate this:
Please Sign up or sign in to vote.
See more: C#
i problem with concept of Synchronization and Asynchronization?

Except delegate is used elsewhere? D'Oh! | :doh:
Posted 7-Feb-11 10:09am
Nishant Sivakumar 7-Feb-11 15:22pm
Surely this is a very fundamental concept, and based on your other threads you are already doing asynchronous programming. What exactly are you confused about?
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

When you send an email you usually don't expect an immediate answer, but continue to do something else - that's like an asynchronous operation. In a day or two, you will hopefully recieve a reply, if it's important you will check your mailbox regularly, possibly sending a remainder too.

When you click on a link on a web page - you wait for the repsonse - that's like a synchronous operation.

Since we actually are talking about programming .Net has a lot of mechanisms to help you out - so some reading might help:

Here is a nice free e-book[^] on threading and synchronization.

Checking out the classes in the System.Threading Namespace[^] is useful too, you should also know about the IAsyncResult[^] interface.

Espen Harlinn
Nishant Sivakumar 7-Feb-11 16:38pm
Good answer, voted 5.

I am still puzzled that the OP's asked this, considering he's been asking questions on threading and async delegate invocation for a few days now.
Nishant Sivakumar 7-Feb-11 16:39pm
Not that there's anything wrong in going back to the basics, because sometimes we all need to do that.
Espen Harlinn 7-Feb-11 16:42pm
Thank you Nishant, probably having the time of his life, learning about .Net :)
Nishant Sivakumar 7-Feb-11 16:43pm
Good to hear it put that way :-)
SAKryukov 7-Feb-11 19:36pm
Espen, that's a good answer (my 5) to a no good question.
You were too nice to OP, and I'm not sure your kindness is good for OP.
"Asynchronization" makes no sense at all. The whole idea of making question like "What's the difference between {0} and {1}?" is plain stupid, sorry. "What's the difference between apple an Apple?"
Manfred R. Bihy 8-Feb-11 5:16am
Oh, oh oh, I can answer that one: capitalization.
Espen Harlinn 8-Feb-11 14:43pm
good one :)
SAKryukov 8-Feb-11 18:55pm
You're sly like devil, I won't try to fool you!
Espen Harlinn 8-Feb-11 14:42pm
Thanks SAKryukov!
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

Asynchronous process: It allows the partitioning of the work, the scheduling of threads, cancellation support, state management. It maximizes the performance of your code while focusing on the work that your program is designed to accomplish.  (Ref: msdn). For example: multiple cores in CPU. Different action process done at the same time with differnt cores.
Synchronous: Works perform in sequence. A thread that finish and then other thread can start. one core in CPU. can do one action process at one time.
In more details. [Synchronous] LINQ. IEnumerable or IEnumerable<T> data source, and have deferred execution, which means they do not begin executing until the query is enumerated.  [ASynchronous]The primary difference is that PLINQ attempts to make full use of all the processors on the system. It does this by partitioning the data source into segments, and then executing the query on each segment on separate worker threads in parallel on multiple processors.
most sentence are taken from mdsn

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 553
1 Dave Kreskowiak 245
2 phil.o 160
3 KrunalRohit 134
4 Sergey Alexandrovich Kryukov 132
0 OriginalGriff 6,951
1 KrunalRohit 4,530
2 Sergey Alexandrovich Kryukov 3,171
3 George Jonsson 2,840
4 Suvendu Shekhar Giri 2,181

Advertise | Privacy | Mobile
Web03 | 2.8.151120.1 | Last Updated 17 Oct 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100