Click here to Skip to main content
15,896,432 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i problem with concept of Synchronization and Asynchronization?

Except delegate is used elsewhere? :doh:
Posted
Comments
Nish Nishant 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?

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
 
Share this answer
 
v2
Comments
Nish Nishant 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.
Nish Nishant 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 :)
Nish Nishant 7-Feb-11 16:43pm    
Good to hear it put that way :-)
Sergey Alexandrovich Kryukov 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
XML
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
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900