Swati Handa

I am doing a project using C#.NET on "Performance evaluation of sequential and parallel execution of various sorting algorithms". I want to know whether parallel programming is possible in C# or not .If possible plzzz tell me how it can be What technique will be used to do so


Re: Visual C# Language How parallel programming is achieved in C#

Alexey Raga

What do you mean by "parallel programming"

Something like OMP No, it is not possible in C#, but possible in C++.

If you just want to manage some parallel tasks you can use CCR (The Concurrency and Coordination Runtime) which has been released recently.
You can find some information abouth this library here: http://channel9.msdn.com/wiki/default.aspx/Channel9.ConcurrencyRuntime






Re: Visual C# Language How parallel programming is achieved in C#

NeederOfVBHelp

Correct me if I'm wrong, but I think Swati might be refering to multi-threading ("...parallel execution of various sorting algorithms"), which is definately possible in C#, and actually quite easy too.

The System.Threading namespace will contain just about every thing you need to do simple parrel execution of algorithrms (assuming the processor the program is run on supports it).

Try using the System.Threading.Thread class; I do not feel I have sufficent experiance in terms of multi threading to tell you exactly how to use it, so I will leave that to some one else.

Good luck! Don't go cross-threading nutin'!





Re: Visual C# Language How parallel programming is achieved in C#

Swati Handa

Thanx for being concerned abt my problem....

Basically parallel programming is to exceute two or more piece of codes (or processes/threads) concurrently (i.e. might be on two processors or on single processor).we want to reduce the time of execution of a sorting algorithm by using this technique i.e. by performing two tasks simultaneously .....

see if you can help us on tht......

swati handa






Re: Visual C# Language How parallel programming is achieved in C#

Swati Handa

Hey can u plzzz tell me whether "data parallel threading" is possible in C#.

In Data parallel threading,you would create threads that rely on independent data sets, for example dividing a video frame into two halves. This allows concurrent threads to make full use of an individuated cache-core configuration.






Re: Visual C# Language How parallel programming is achieved in C#

NeederOfVBHelp

Of course it is! Infact it is much easier than other types of multi-threading as thread saftey will not be a concern.



Re: Visual C# Language How parallel programming is achieved in C#

Figo Fei - MSFT

Hi,

You may mean Asynchronous Programming with multithread.

Here is the references:

http://msdn2.microsoft.com/en-US/library/3e8s7xdd.aspx

http://msdn2.microsoft.com/en-us/library/ms228969(VS.80).aspx






Re: Visual C# Language How parallel programming is achieved in C#

Matthew Watson

There's some C# code here that claims to do a multithreaded sort:

http://www.c-sharpcorner.com/UploadFile/indikamw/SortingusingMultithreading11172005045152AM/SortingusingMultithreading.aspx




Re: Visual C# Language How parallel programming is achieved in C#

Swati Handa

Hey thanx 4 all such helpful links and replies...can anyone plzzzz tell me tat how i can achieve data parallel threading in C#..how do we apply this technique in C#..it would be really helpful if someone can illustrate this with an example..




Re: Visual C# Language How parallel programming is achieved in C#

Swati Handa

Thanx Mr. Watson 4 ur link..it was a gr8 help..we went thru that project and the code given in that zip file..can u plzzz tell us that which technique of multithreading(functional or data parallel threading) has been incorporated in this code 4 sorting..n whether the code has been executed on single core or multi core processors corresponding to which execution time is calculated..it would be really grateful if u can provide some other example of data level parallelism in C#..