Click here to Skip to main content
15,885,733 members
Everything / Parallel

Parallel

parallel

Great Reads

by Kenneth Haugland
Implementation and theory behind TLM modelling for acoustic wave propagation with 2D and 3D view. Also includes a raindrop and boat wake simulation.
by Sacha Barber
Using the VS2010 Tasks namespace.
by Arthur V. Ratz
This article is a practical guide on using Intel® Threading Building Blocks (TBB) and OpenMP libraries for C++ based on the example of delivering parallel scalable code that implements Burrows-Wheeler Transformation (BWT) algorithm.
by Arman Aşçı
Parallel port data register control with C# .NET 2.0 and inpout32.dll.

Latest Articles

by ToughDev
Emulate parallel port printer to capture data from Tektronix 1230 Logic Analyzer
by PascalLandau
In the fifth part of this tutorial series on developing PHP on Docker we will setup some PHP code quality tools and provide a convenient way to control them via GNU make.
by Ciumac Sergiu
Explains sound fingerprinting algorithm, with a practical example of detecting duplicate files on the user's local drive.
by MehreenTahir
This article is a continuation of Programming Concurrency in C++ Part 1. We will discuss synchronization, future and promises along with async and with that, will sum up the introduction of concurrency in C++.

All Articles

Sort by Score

Parallel 

12 Oct 2013 by Kenneth Haugland
Implementation and theory behind TLM modelling for acoustic wave propagation with 2D and 3D view. Also includes a raindrop and boat wake simulation.
2 May 2017 by Arthur V. Ratz
This article is a practical guide on using Intel® Threading Building Blocks (TBB) and OpenMP libraries for C++ based on the example of delivering parallel scalable code that implements Burrows-Wheeler Transformation (BWT) algorithm.
17 Aug 2012 by Arman Aşçı
Parallel port data register control with C# .NET 2.0 and inpout32.dll.
5 Nov 2017 by Chris Maunder, Henry Gabb
A rambling chat about parallelization, vectorization, Intel® Parallel Studio XE and how sometimes you really need to trust the tools you use.
25 Nov 2018 by Bartlomiej Filipek
What performance can we get from C++17 parallel algorithms?
10 Jun 2017 by Alon Lek
Running tasks in parallel while taking into account the dependencies between them
28 Nov 2011 by Adnan Boz
In this blog post, I’m diving deeper into Thrust usage scenarios with a simple implementation of Monte Carlo Simulation.
21 Aug 2009 by User 5271454
Utilizing the CCR to manage and execute plug-ins.
12 Aug 2011 by George Mamaladze
Parallel Programing, PLINQ and Globalization
3 Dec 2011 by Wonde Tadesse
In the parallel for loop the loop size is not inclusive to the loop where as in normal for loop the loop size included. Take look at for detail for Parallel Programming[^] MSDN article.
15 Jun 2012 by enhzflep
Gday, I'm not so sure I understand each of your points and your questions - though I'll do what I can to address them.XBox, PS3 actually only have a couple of cores, like PCs. PS3 - 8 for the cell, 6 as implemented in ps3 variants.Xbox360 - 3 for the PowerPC XenonJust like PCs, the...
23 Oct 2012 by CPallini
A starting point: "Parallel Programming in .NET Framework 4: Getting Started"[^].
25 Dec 2014 by Yin Kan (Gavin) Lee
Stream large result set from Web API to WPF on background thread and display on Datagrid
19 Mar 2014 by Sergey Alexandrovich Kryukov
Let me give you a really short introduction.You can use threads in a way abstracted from the CPU cores. And the OS associates cores with threads using its own. In almost all cases, this is the very best option. I would not recommend touching process and thread affinity at all. The cases when...
3 Dec 2018 by Amir Emamjomeh
A study of .NET Parallel Class in solving a system of linear equations using bi-conjugate gradient stabilized method
14 Dec 2014 by D Sarthi Maheshwari
A look at possible parallel-producer-consumer patterns (Second Part)
19 Mar 2015 by Jake Drew
How to mine webpages in parallel
15 Jun 2012 by Stephen Hewison
More cores quite simply means you can do more at any one time. Most cores also support threading. Processors work using something called the fetch execute cycle. This cycle has 4 stages and it's possible for 4 separate threads to work within a single processor as each one exists within each...
25 Feb 2015 by _Asif_
You can find valuable peice of information from this Disappointing performance with Parallel.For[^]
25 Feb 2015 by Maciej Los
Solution 1 by _Asif_[^] is very good, even if does not contain exact answer. Traditional for loop is faster than Parrarel loop and even Linq method too:List Days = Enumerable.Range(1,31).Select(x=>x.ToString("00")).ToList();Time of execution:1) traditional: 00:00.070 s2)...
3 Jun 2011 by Dave Kreskowiak
Without setting processor affinity, you can't.It's also a bad idea unless you have VERY SPECIFIC reasons for doing so and know the pitsfalls.One such pitfall is that you limit your code to running on single core even if the core is also busy doing other things and other cores are idle. ...
2 Jan 2014 by Sergey Alexandrovich Kryukov
Instead of "parallelizing" the way you do, don't use GetPixel/SetPixel; these methods are prohibitively slow and can only be used to get or set very few pixels. Instead, lock bit and process them in...
31 Aug 2014 by TheCannyCoder
Parallel Streams and Spliterators
25 Feb 2015 by Stefan_Lang
The loop can't be parallelized to start with, since Days.Add() requires sequential processing. Therefore parallel.for just adds overhead without improving performance.The key thing to look for is whether there is a variable that gets modified with each execution.In this case, Days is...
29 Apr 2016 by OriginalGriff
A better method for safety critical systems is true redundancy: Redundancy (engineering) - Wikipedia, the free encyclopedia[^]The hardware is duplicated, the software is written by different teams, and two out of three can "out-vote" the third. Purely duplicating the same calculation in...
23 Jan 2018 by OriginalGriff
Threading is complicated, because it's non-deterministic when exactly thread runs, and how long they run for. The "problem" is that each thread requires a core to run on: so the more cores your processor has, the more thread it can actually run at the same time. If you have two cores, then only...
8 Jun 2011 by Espen Harlinn
As Niklas Lindquist mentions: If the data is availalbe in memory before the threads start - possibly using a memory mapping - and the data is not altered by the threads. there is no need to protect the memory using a locking mechanism, just access at will. If each thread writes it's results to a...
15 Jun 2011 by Wayne Gaylard
Your best bet would be to use the Task Parallel Library (TPL). The TPL will automatically scale to include all cores on the machine in which it runs. So you could do something like thisvoid q1() { } void q2() { } void q3() {}void Run() { ...
15 Jun 2011 by Sergey Alexandrovich Kryukov
First of all: in most cases, you should not control it explicitly. Could you explain why doing so?The system runs several threads on several cores. Which core is loaded with which thread at each thread time spice is decided by the system threading scheduler.However, there are ways to...
21 Oct 2011 by Ezra Neil
Reading at your question, the first thing that come to my mind is multi-threading. Backgroundworker is threading too but you cannot effectively have more than one threads at a time.Create your own threads and by doing this you can dynamically add more threads as needed. Creating own threads...
3 Dec 2011 by Addy Tas
Hi,You have tried to parallize a calculation where the result of one iteration is dependent on the previous. If the sum was not used in the multiplication the value would not be transferred to the next iteration. You can only parallize stuff where iterations have no relation to each...
3 Dec 2011 by Eduard Lu
The reason is,,,, the value of sum was changed from the 1st for loop and used again in the second block of codes. Try using 2 different variables like: sum1 and sum2Regards,Eduard
13 Dec 2011 by E.F. Nijboer
Have a look at the ThreadPool class and TaskScheduler class. And... I think the third link might be a good example of what you are looking...
15 Mar 2012 by Dharmateja Challa
Using parallel_for_each which is part of Parallel Pattern Library ( PPL )
18 Nov 2012 by Sergey Alexandrovich Kryukov
Your collection type should be thread-safe. It is not, this is not a problem, but you should make all calls you use thread safe, by simply wrapping each of them in the lock statement on the same lock object: lock(someLockObject) firstsortedlist.Add(item.Key, item.Value);// where...
22 Sep 2013 by OriginalGriff
Your questions, in order:Maybe.Possibly.Probably not.Yes.Yes.Yes.If you have N cores, then N threads can truly run in parallel (provided they do not want to access the same resources, including memory objects). However, not all the threads in the system are yours - yours will...
5 Oct 2013 by Ron Beyer
Its a common misconception that creating multiple threads will automatically improve the performance of a long running task. As long as you let the OS determine processor affinity there is no guarantee that the threads will run in parallel.I'm sure that you know that a single core even...
3 Dec 2013 by Stefan_Lang
Various parallel frameworks such as OpenMP offer ways to automatically spread workload without your need to control it. Check your preferred parallel frameworks documentation if you're using one.Without framework, a good pattern to use is master/slave or worker pattern: One "master" thread...
30 Jun 2021 by Member 10052408
Hi All,I have multiple tasks and i need to run them on specific multiple cores or processors simultaneously. For Example, if i have two different tasks or just one task but will run it twice i want to run these two tasks on specific cores or processors simultaneously like task1 will...
7 Mar 2016 by Sascha Lefèvre
As long as you're only reading and not modifying values anything is thread safe.
7 Mar 2016 by Matt T Heffron
Sascha is correct about thread safety.However, if you are using the .AsParallel() to improve performance, you're going about it incorrectly!Since bg is a List, the .Contains() is a very poor way to check for membership in the list. It is O(n) (where n is bg.Length). So the overall...
20 Apr 2016 by Jochen Arndt
In your call to MPI_Gather(c + (size/nproc*rank), size*size/nproc, MPI_FLOAT, c + (size/nproc*rank), size*size/nproc, MPI_FLOAT, 0, MPI_COMM_WORLD);the send and receive buffers are identical which is not allowed when not using the MPI_IN_PLACE[^] option.
9 May 2016 by Patrice T
Before using threads, you should start by optimizing your code.Just a few optimizations:- Everywhere, you use convertToString(0), replace with '0'. Same for convertToString(1) and '1'.Wait ...you have 3 nested loops for(int r=0;r
27 Feb 2017 by theonemule
To fully take advantage of parallelization features, developers have to change how they code. But a great deal of optimizations can be made through Intel’s parallelization tool, Intel Advisor.
21 Aug 2017 by OriginalGriff
If you look at the List documentation - List Class, MSDN[^] You will find this at the bottom: Quote: It is safe to perform multiple read operations on a List, but issues can occur if the collection is modified while it’s being read. To ensure thread safety, lock the collection during a read...
13 Nov 2017 by KarstenK
The explanation is already in your post: pFrame 0x00000000 Reading the documentation is always a good idea. In the text of AfxGetMainWnd you may had read "If the function is called from a secondary thread in the application, the function returns the main window associated with the thread that...
27 Nov 2017 by Kenneth Haugland
In the header, you ask about matrix multiplication, while in the question you ask about transposing a matrix. Transposing a matrix is just to switch the rows and columns: TransposeA[i][j]=A[j][i] Matrix multiplication is a bit more cumbersome as you need to make sure that the columns in the...
27 Jul 2018 by nchamberlain
The Sleeping Barber problem, a classic inter-process communication problem, can be studied and explored more easily using tools such as the Concurrency Explorer than using standard parallel or asynchronous coding techniques.
3 Sep 2020 by Richard Deeming
Try using a Tuple for the local state: Parallel.ForEach(files, Function() (Length := 0L, Count := 0L), Function(f As FileInfo, loopState As ParallelLoopState, index As Long, accumulator As (Length As Long, Count As Long)) If...
12 Feb 2021 by k5054
Have you checked that your input file is not in DOS format (i.e. ends in a CRLF rather than just an LF)? You can check this using the FILE command: $ file test.txt test.txt: ASCII text, with CRLF line terminators $ If it is in DOS format you...
21 Apr 2021 by Maciej Los
Start here: Conversion from type 'DBNull' to type 'String' is not valid. at DuckDuckGo[^]
7 Oct 2021 by User 9916080
This maybe what you are looking for. From Google: Epson TM-T88III Drivers[^]
8 May 2023 by ToughDev
Emulate parallel port printer to capture data from Tektronix 1230 Logic Analyzer
3 Jul 2010 by Amir Zuker
I've been playing around with the parallel extensions shipped as part of the .NET 4.0 and Visual Studio 2010 RC. Turning immutable atomic self-contained CPU-bound operations to run in parallel is pretty easy. However...
19 Apr 2011 by dan!sh
Following should help:1. Learn Parallel programming.2. Think of an idea for the project (It's your project after all). Still if you are clueless, try Article Writing forum.3. Start working on it.4. Ask specific questions if you are stuck anywhere.Someone giving you ready to use...
20 May 2011 by E.F. Nijboer
This example is also on the wiki where they use barriers. stdout doesn't have to be thread safe. Have another look at the wiki on this:http://en.wikipedia.org/wiki/OpenMP[^]Good luck!
20 May 2011 by fresh_girl
as I was trying to learn openMP , I came across this sample of code #include #include // Include OpenMPint main(int argc, char **argv){#pragma omp parallel num_threads(10) { int threadNum; threadNum = omp_get_thread_num(); printf("This is thread...
3 Jun 2011 by jiji2663
helloi want to set a thread or task to one core's of cpu and manage it in c#?of corse whitout Process.GetCurrentProcess().ProcessorAffinity please F1F1F1F1F1F1F1F1 !!!!!!!!!!!thnx
8 Jun 2011 by neha.arora44c
I have a code which has a loop which takes around 2 hrs to complete one iteration. I have to execute 12 iterations and therefore the code takes around 24 hrs to complete. I have a 16 core processor to my access. I wish to parallelize the loop such that I have 12 threads, each executing one...
15 Jun 2011 by neha.arora44c
I wish to write a code of the following format:main(){}a(){}b(){}c(){}d(){}....k(){}I wish to run the code in parallel such that 1st 5 functions have a processor to themselves(assuming 12 cores are available on the system)After any of the 1st 5 finishes...
19 Sep 2011 by MaulikDusara
Hi,Refer below links, might be helpful to you.Parallel Computations in C#[^]http://blog.csharp-online.net/?p=135[^]http://www.csharphelp.com/2010/07/using-the-parallel-class-in-c/[^]
24 Sep 2011 by Ratika Agarwal
Parallel execution time is more than sequential code.(Code has been executed on dual core processor.)Why is it so??First run this, then comment the parallel code & uncomment sequential code, then again run it & check both the run times./*****NOTICE:- Please do not run both,...
22 Sep 2011 by OriginalGriff
I'm not surprised: there is a both an extra loop in the parallel version:for (int j = 1; j
29 Sep 2011 by shriram.goal
My final year project is to develop fault tolerance in grids and I'm planning to achieve this through checkpointing/logging of processes and job replication on the occurrence of faults. My project guide has advised me to create a grid using Java program(s) and I have absolutely no clue as to how...
29 Sep 2011 by Richard MacCutchan
In answer to your reply above I would make the following comments:shriram.goal wrote:Moreover, why am I going to post my question in a forum if I possess all knowledge about the subject in which I'm about to work on?If you possess all knowledge then I don't understand what your issues...
10 Oct 2011 by Shand Ramzi
Hello.So I am currently working on a project and now I feel the need to try and speed up the execution. I have a method with a foreach loop in it that I wish to parallelize as efficiently as possible.This is how it looks now:public void Simulate(){ List Locations =...
19 Oct 2011 by DANAOS_master
Hi folks,we have a dashboard application that presents data according to dynamically executed SQL read from a database.Up to now application connects to the database, loops against the grids (that present data), reads their SQL source, executes the SQL, presents the results in...
31 Oct 2011 by Aron Weiler
Parallel for loop in C#
3 Dec 2011 by jackrasha
Why is not The answer same following? Why is not The answer same following? Normal coding :for (long i = 1; i
13 Dec 2011 by Freeboss
Hi, I am looking for a way to set a Fixed concurrent tasks number..As far as i know Task.Factory does not have anything like and i'm stuck.I've also though about the BlockingCollection and the Producer-Consumer model but i'm not sure if this is the right implementation as i have about...
16 Jan 2012 by alianzalima1978
hi everyone!i'm working with a simple image process program using open mp,but can't get make my program faster as it's supposed to be.the process time of the code bellow was 0.5secs.but with the open mp line commented out, it was only 0.1secs.i can't see what is going on.please...
15 Jan 2012 by Sergey Alexandrovich Kryukov
Did you gain 5 times in performance? This is better result as I would expect. How could you expect more if you only have 2 cores? Do you think parallel processing is the miracle, can draw power from nowhere? :-)—SA
15 Jan 2012 by Jochen Arndt
The inner loop var x is shared by default. You should make it private:#pragma omp parallel for private(x)This should boost performance. But I'm not sure if this is all.
16 Jan 2012 by Stefan_Lang
simple image process program using open mpThat is the first mistake: Multithreading is never simple!The second problem is memory access: I don't know how clever OMP goes about it, but I doubt it will recognize that for each y you access values from a very specific range of memory, and...
18 Mar 2012 by Ratika Agarwal
I am coding in c#.net 4.0 for my project on parallelism.After coding I came across a problem that parallel exec. time is coming more than sequential one.'x' and 'y' are global arrays variables. Program object1= new Program(); Program object2= new...
18 Mar 2012 by OriginalGriff
Parallel does not mean that things happen at the same time. All it means is that operations can occur in separate threads, which may (or may not) run on separate cores. This assumes that there are free cores to run the threads, or all that happens is that the extra overhead of establishing the...
21 Mar 2012 by Vignesh renganath
I need to design a custom data glove for my project. in one end of the glove am using LED light and in another end am using a photo detector and both the LED and the photo diode are placed inside a heat shrink which is stuffed with the transparent wire which conducts the light(similar to...
24 Apr 2012 by SASS_Shooter
If I understand your question correctly -- you want to have computation threads performing in parallel to make this look run faster. Is this correct?You need to break this down into simple steps then you can turn it into a multi-threaded process.1) break out your computation in your...
24 Apr 2012 by Leonardo Paneque
In order to convert a solution to parallel you need to check also for output and input dependencies. for example it is not possible to run Fibonacci numbers in parallel, because a value X, depends on previous values x-1 and x-2.So that being said, be aware that not everything can be...
24 Apr 2012 by Armando Martínez González
as of this http://tipsandtricks.runicsoft.com/CSharp/ParallelClass.html[^]i think parallel for wont do what i needbut i think im on to something with this but im not sure yethttp://msdn.microsoft.com/en-us/magazine/cc163340.aspx[^]
15 Jun 2012 by shankha2010
Hi All, After reading about parallel programming by multicore processor,I have some doubts. Its undoubtedly best idea for play stations,X-Box [as they have soo... many cores] But will it prove to be effective for core i7 running 8 parallel process then running 100 thread in Windows...
27 Jul 2012 by OriginalGriff
If you look at the MSDN page for BindingList[^] you will see the following at teh bottom:"Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe."This means that the threads are interfering with each other!...
7 Sep 2012 by BrianHamilton
Hi,I'm looking for apps to develop to increase me knowledge of parallel programming. I did one with a pivot sort but I'm wondering is something like a primality test would be worth doing or if anyone has any other ideas. I'm not looking for coded solutions, just ideas. I'm not really...
7 Sep 2012 by BobJanova
Any problem where there are several computationally expensive and independent tasks that need doing is ripe for parallelism. A Mandelbrot generator or similar could be a good intellectual exercise. In the real world it's usually when you're trying to simulate something with varying parameters,...
18 Nov 2012 by Member 9574034
According to code segment, is it thread safe? if not what should I do?Second, Is there any relation between number of cores of CPU and number of tasks?var t = new Task[2]{ Task.Factory.StartNew(()=> { foreach (var item in firstsortedlist) { ...
19 Dec 2012 by CHill60
The performance impact of too many locks defeats the object of multi-threadingSee http://tipsandtricks.runicsoft.com/CSharp/ParallelClass.html[^] for a fuller explanation.
18 Jan 2013 by OriginalGriff
Multithreading or parallel may or may not speed things up - it can actually slow things down because of the processing overhead in setting up the thread / tasks and allocating separate memory space for them. In addition it depends what else is going on - if each thread needs to talk to SQL then...
25 Feb 2013 by krushna chandra jena
Hi Everyone..... I have a list view , where i want to show a collection of data recursively ..., I use back ground worker to keep my user interface active .., i also use Parallel.ForEach to load the data in list view at a time .My code is:public void bg_DoWork(object sender,...
25 Feb 2013 by Jegan Thiyagesan
Hi,You are trying to access a control in other threads that was created in main thread. The exception you will get from your code is the Cross-thread exception.Try the code below:delegate void SetListviewItemsCallback(ListView.ListViewItemCollection listViewItems);private void...
28 Feb 2013 by Animesh Datta
Hi Everyone...I have a Parallel.Foreach loop by which i load a listview , i have a button for stop the execution.Now my question is , when the execution is going on if i push the button then the process will be stopped .I found some code in net but nothing happens.my code is private...
11 May 2013 by shaikmohammedaamear mits
I am creating an application where i am moving files from one directory to another, where i have a function which process moving files.My problem is i have four directories where i want to process my function to move files parallellyby perfoming multithreading process but my function...
11 May 2013 by OriginalGriff
Set up a BackgroundWorker thread for each directory - they can share the same code, provided they don't affect any UI elements directly, and only use parameters and local variables (not class level variables: you would need locking for that).The MSDN page on BackgroundWorker includes a...
18 May 2013 by John Michael Hauck
“Programming Massively Parallel Processors (second edition)” by Kirk and Hwu is a very good second book for those interested in getting started with CUDA.
13 Aug 2013 by rocky_em
I can't upload a file into my domain, that is hosted bya hosting company called PARALLELS PLESKMy aplication is written in .NET and when I try to upload a smallHTML file, I always get the following error:Access to the path '/View/SavedTemplate' is denied.i tried to resolve this...