Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: (untagged)
i problem with concept of Synchronization and Asynchronization?
 
Except delegate is used elsewhere? D'Oh! | :doh:
Posted 7-Feb-11 10:09am
Comments
Nishant Sivakumar at 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
good
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.
 
Regards
Espen Harlinn
  Permalink  
v2
Comments
Nishant Sivakumar at 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 at 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 at 7-Feb-11 16:42pm
   
Thank you Nishant, probably having the time of his life, learning about .Net :)
Nishant Sivakumar at 7-Feb-11 16:43pm
   
Good to hear it put that way :-)
SAKryukov at 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?"
--SA
Manfred R. Bihy at 8-Feb-11 5:16am
   
Oh, oh oh, I can answer that one: capitalization.
Espen Harlinn at 8-Feb-11 14:43pm
   
good one :)
SAKryukov at 8-Feb-11 18:55pm
   
Manfred,
You're sly like devil, I won't try to fool you!
--SA
Espen Harlinn at 8-Feb-11 14:42pm
   
Thanks SAKryukov!
Rate this: bad
good
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
  Permalink  

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



Advertise | Privacy | Mobile
Web04 | 2.8.141220.1 | Last Updated 17 Oct 2012
Copyright © CodeProject, 1999-2014
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