Click here to Skip to main content
15,891,529 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 Title

Parallel 

21 Nov 2011 by dmihailescu
UI and concurrent programming using IAsyncResult, BackgroundWorker, TPL, and ‘async’ syntax.
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...
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...
26 Feb 2015 by Sergey Alexandrovich Kryukov
It looks like you copy and paste some assignments. This is not a question, this is pure abuse. No wonder, it will be automatically removed due to abuse reports. Don't do such things.—SA
15 Aug 2012 by Arman Aşçı
Time division multiplexing between 6 x 7-Segment displays control with Parallel Port and x86 assembly.
27 Jun 2010 by Wayne Wood
Verify the execution efficiency of a short CUDA program when using the library thrust
1 Jul 2010 by Wayne Wood
Verify the execution efficiency of a series of short .NET 4.0 parallel programming samples
3 Feb 2010 by User 4677916
This article presents a reusable class and technique for easily doing Asynchronous Programming using the Begin/End Pattern and the new Reactive Extensions for .NET (Rx) library.
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
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...
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...
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...
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.
7 Oct 2021 by User 9916080
This maybe what you are looking for. From Google: Epson TM-T88III Drivers[^]
7 Aug 2014 by Yannick Brodard
So I have this command :public DelegateCommand GenerateReportForAllClientsCommand { get; set; }public bool CanExecuteGenerateReportForAllClients(){ return true;}public async void GenerateReportForAllClientsExecute(){ if (ClientList.Count
10 Aug 2014 by Yannick Brodard
By searching the web, I found a convenient answer to my problem.I had an other async / await in my GeneratePdfReportAsync method, and I've discovered that a Task or Task object need the UI Thread to be available. But in this case for this method, I didn't need the UI Thread, but it was...
9 Apr 2015 by Girish J Jain
In this post, I am going to talk about asynchronous programming in Microsoft .NET Framework in the form of questions and answer.
5 Jun 2018 by Nikola M. Živković
Task based asynchronous pattern in .NET
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...
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...
29 Aug 2013 by Keith L Robertson
Write synchronous-looking asynchronous methods without async/await in Visual Studio 2010.
21 Sep 2013 by shehrozeee
I have a question.If I use a backgroungworker provided in .Net to do some intensive work, will it run on on the same core (I have a quad-core machine) as the parent thread (main thread that created this background worker)?If I make about 5-10 background workers will they start on different...
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...
22 Sep 2013 by Sergey Alexandrovich Kryukov
First of all, you need to create multiple threads only if your need parallel independent processing logic dictated by the semantic of your application. If you hope to improve performance using threads, you well make it only worse if the number of threads exceed the number of cores. Remember that...
22 Sep 2013 by Mike Meinz
See Solution 1 of Database connection every 1000 milliseconds by Timer interval problem[^]When I originally developed this application, it accessed nine different servers one at a time using Web Services to gather data. That took about ten minutes. When I changed my software so that it...
17 Aug 2017 by Member 12915728
Please share info on how to functionally access ports in Windows 10 using C++ (compiled with g++). Please include all #include files and code necessary to test I/O Parallel Port Pin Programming. Thank you What I have tried: /*** Following Code Compiles but DOES NOT modify ports ***/ ...
17 Aug 2017 by KarstenK
I personally prefer other API like WriteFile which also works with COM ports. The link is good starting point to get an overview with some links to sample code. Take also a look at this great article about Serial library for C++.
23 Jan 2018 by akash_waits
Hi All, I am using the below code to Call 5 methods in Parallel and then waiting to received response from all the methods before proceeding further. Task t1 = Task.Factory.StartNew(() => LookUp1(lookUpObj)); //09:28:41.594538 Task t2 =...
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...
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...
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...
19 Mar 2014 by Yandy Zaldivar
Hi, I am going to give you two solution and you choose one or another depending in your needs. I didn't use your code demo as a guide but the text of your question.- Choose the ThreadApproach if you want to have explicit control over the thread that will run your task including the processor...
21 Mar 2014 by Member 10052408
I tried both methods , threadapproach and taskapproach, but i couldnt get two or more tasks start to run simultaneously because when i check cpu utilization, i see that only one of the specific processors is working with 100%, but what i want is two or more specific processors should work with...
25 Mar 2014 by Yandy Zaldivar
Hi, the problem in your design is that you are using a Processor level Affinity Mask. If you set if to 2, then all your threads will run on processor 2 and if you set it to 3, then all your threads will run on processor 3.If you want that thread 1 run on processor 2 and thread 2 run on...
30 Dec 2014 by Babu_Abdulsalam
Various features supporting Concurrency in C++11
18 Apr 2017 by Bhola Ram Sahu
I want to do a small program that calculates eigen value and eigen vector in parallel processors using MPI. I have written a code that works correctly but its for uni processor. Please help me with some code for parallel processor. I want to compare the processing time for different number of...
18 Jan 2013 by SandhyaPillai
Here is the scenario: I have a dll which has method that gets data from db, depending on parameters passed, does various checks and gives me required data.GetGOS_ForBill(AgencyCode)In a windows application, I have listbox which list 500 + agencies. I retrieve GOS for each agency append to a...
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...
28 Oct 2013 by Member 10365929
Looking for a way to read and extract data from printer spooler - basic text.Printer is connected via parallel or usb or serial.Please help!
8 May 2023 by ToughDev
Emulate parallel port printer to capture data from Tektronix 1230 Logic Analyzer
18 Dec 2013 by Member 10474952
Hello All - I am looking to capture ascii data from a parallel port output from a machine - this device is not a pc - but it is collecting datat & printing a table of numbers to an epson lx300+ printer - Can anyone help me devise a solution to this problem ? Thanks in advance Marty
21 Aug 2009 by User 5271454
Utilizing the CCR to manage and execute plug-ins.
29 Oct 2008 by User 5271454
Sequential Asynchronous logging example using the CCR
16 Dec 2016 by Member 12908639
i'm trying to make a windows form program to teach the c# language...so i need to give an exercise ( like add 2 integers and show their sum )the user must put their code in a text box and the compiler will process itbut now it comes that part ,, that the exercise might have more...
16 Dec 2016 by Patrice T
I hope you will get ideas in those sites.This one is to teach you programming:Learn to Program[^]and this one is to teach you languages:W3Schools Online Web Tutorials[^]in both sites, you type your own code, and it is ok when you reach the wanred result.
11 Nov 2010 by Ajay Vijayvargiya
Learn about parallel algorithms, parallel containers, tasks, task groups, agents library, task scheduler etc in VC10
20 Nov 2018 by Shivprasad koirala
This article will explain the difference between concurrency and parallelism. Concurrency vs parallelism has been a debated topic for a long time.
3 Jan 2008 by Marc Clifton
An overview of Microsoft's Parallel FX initiative, including the Task Parallel Library and PLINQ.
9 Jan 2015 by Syed Muhammad Ali Gardezi
Hey guys I wanted to know how to install and attach MPI libraries in a c project using eclipse. Please tell me how to do it. I've surfing for 4 hours but I can't find a solution.
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...
8 Jun 2011 by barneyman
don't use global data; it's an anathema to multi-threaded code ...By all means use a data pointer which is created by the master thread and used by the children ....What conflict are you experiencing? reading the data should be fine, however, if you're writing data into anything that's...
8 Jun 2011 by Albert Holguin
Use a mutex variable if you need to control access to a data array from multiple threads.
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...
11 Jun 2011 by neha.arora44c
Thanks. :)Apparently the conflict was in writing the data to the files... All of them were accessing the same file together.
30 May 2004 by Taha Elsayed
Control electrical appliances using PC.
14 May 2015 by anurag.netdeveloper
Hi All, I have billions of records and i have to do some long calculation on those records. If I am using a sequential for loop then it takes around 7hr to complete that task which is not affordable. To overcome with this, I’m using Parallel.For but the catch is concurrency is occurred in...
14 May 2015 by Frankie-C
You need to isolate thread local data for each concurrent threads.First of all read about TLS Thread Local Storage[^], then figure out how to use them in your project.For samples read this[^], or google for "C# thread local storage example".The Parallel.For Method exist also in a flavour...
10 Jun 2017 by Alon Lek
Running tasks in parallel while taking into account the dependencies between them
26 Aug 2013 by Buddhi Chaturanga
I want to distinguish of these two technologies relevant to their technological aspects.What are major differences and usage of each one of them?Pros and Cons.How we can handle process through GPU using each one of them?How those technologies can be implemented for 3D game programming?
27 Aug 2013 by Stefan_Lang
Basically, CUDA only works for NVIDIA cards, whereas OpenCL supports all. In theory. To my knowledge the only usable implementation for OpenCL is by AMD; NVIDIA also implemented OpenCL for their cards, but didn't put a lot effort into it.CUDA only is more powerful than the more generalized...
23 Jun 2020 by Ciumac Sergiu
Explains sound fingerprinting algorithm, with a practical example of detecting duplicate files on the user's local drive.
12 Apr 2012 by Rong(Rex) Fan
class Program { static void Main(string[] args) { Stopwatch timer1 = new Stopwatch(); Stopwatch timer2 = new Stopwatch(); timer1.Start(); int max = 10000000; ConcurrentBag intQueue = new...
3 Sep 2012 by Christopher Diggins
An informal survey of implementation techniques of the map higher-order function for arrays in C#.
22 Nov 2013 by NeonMika
Hi codeproject-community!I'm just diggin' into the TAP and I'm hoping you can help me with a problem.Let me first explain what I want to achieve:I want to read from a RSS-feed every 10 seconds and want to write it's items to output it somehow on my form.My idea:I wrote an...
22 Nov 2013 by bowlturner
And why can't you just use System.Threading.Thread.Sleep(10000); in the while (!cancellationToken.IsCancellationRequested) Block?As far as how to wait for the GetRssItems you can use the ContinueWith to call a 'finish' or 'next' I have thisprivate void StartTask(long...
22 Nov 2013 by NeonMika
Okay, after reading some blogs i found some solution that work's pretty good for me: private Action getRss = null; private TaskScheduler ui = TaskScheduler.FromCurrentSynchronizationContext(); public ObservableCollection GuiListRssItems = new...
3 Jul 2015 by DrABELL
Serial and Parallel implementation of efficient Prime Factoriing algorithms
20 Apr 2016 by Member 12472890
Hello, I've just recently been messing around with my parallel programming in MPI (OpenMP after this!) and I ran a code to multiply matrices on a virtual machine (Ubuntu) with 4 cores. Unfortunately, I got an error:Fatal error in PMPI_Gather: Invalid buffer pointer, error...
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.
21 Apr 2018 by Wade Harvey
This article shows how to use Winforms, WPF and C# to create a File Explorer Clone with Tabs and an extremely fast parallel file search utility.
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...
4 Oct 2017 by Bhairav Thakkar
A robust framework for complete implementation of Finite Element Analysis in VB.NET
3 Feb 2018 by Paulo Zemek
A dictionary implementation optimized for caches and the GetOrCreateValue method, supporting real parallelism while reading and avoiding some problems encountered in the ConcurrentDictionary
13 Feb 2021 by Member 15071189
This is the first time I am trying to do python execution in GNU parallel. I have the below python script. I am trying to run it in parallel with a text.txt document loading the variables. The text document has the variables one on each line. ...
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...
13 Feb 2021 by k5054
I know this has been solved, but it occurred to me that there might be an issue with the code as presented. Namely, SQLite does not do concurrent writes to the database, so unless the full problem is compute bound, its probably quicker to do the...
13 Oct 2012 by Alesiani Marco
A Wave PDE simulation using GPGPU capabilities
24 Apr 2012 by Armando Martínez González
first of all I apologize for my Englishi am trying to optimize/speed up some code i madeto make a texture with the information of the depth frame provided by a kinecti have been looking at System.Threading and other stuff but haven't been able to make this parallel any help would be...
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[^]
25 Apr 2012 by Armando Martínez González
at last i got a hold of something usefullhere maybe this will help another noob like me void Calling_Method_In_Separate_Thread() { ParameterizedThreadStart parameterizedThreadStart = Method; var thread = new Thread(parameterizedThreadStart); ...
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
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. ...
3 Jun 2011 by Sergey Alexandrovich Kryukov
Except for process affinity, there is also a thread affinity.Please see my past answer: How to program multicore[^].Again, in agreement with Dave, don't interfere in thread/process affinity unless you know exactly what are you doing!—SA
21 Dec 2022 by Reza jafery
Hi guys, In my article, I want to compare the speed of sequential processing to parallel processing in various conditions, so in one example, I want to convert the following sequential command to parallel, but after converting it to parallel, it...
16 Dec 2022 by OriginalGriff
Multithreading isn't a magic bullet: it can't just speed up your code and give you massive speed improvements, and it certainly won't give you repeatable results every single time. The reason why is simple: you have N cores on your processor: 1,...
21 Dec 2022 by Reza jafery
I found a good example: using System; using System.Diagnostics; using System.Threading; using System.Threading.Tasks; namespace ConsoleApp { class Program { const long LOOP_COUNT = 900000; static long Calculate() ...
21 May 2015 by vinayvraman
Hi All,I have a question regarding cancellation of tasks. Please read below for the explanation. Any suggestion would help me solve the problem.I have 3 tasks. Lets call them task1, task2, & task3. Each of them are independent except for the data. i.e. task1 puts data into a queue1 and...
22 May 2015 by Mathi Mani
Hi,What you are trying to do can be done. But it cannot be answered in this quick answers section. It is a pretty vast topic. Here are some articles that help you understand the concept and implement a solution.Process task based on the outcome of the previous...
7 Jul 2015 by Member 11682338
I need to do datatransfer with my older 16ch Sony Dat recorder. This is connected to the PC via parallel port IEEE 1284 EPP mode standart. How to use parport.sys to do propper handshake ... ?
25 May 2015 by Abhishek Kumar (here to help!!)
Hi,I'm using Parallel.ForEach to read files and then insert processed information into database. There may cases when multiple files my reside similar data and while saving to database, in this scenario I need to updated previous record instead of creating a new...
25 May 2015 by Shmuel Zang
Typically, you can make your method thread-safe, by wrapping the critical sections (the code that use the common resource) with a lock statement. In your case, it seems like the critical section is the DB access in the InsertData method.
25 May 2015 by vinayvraman
Use "lock" before calling InserData. This way you will be sure that only 1 thread will be updating the DB. But it beats the necessity of Parallel.ForEach. Nevertheless if there is lot of data processing happening before InsertData then lock just before Insert should give you better results than...
25 May 2015 by Frankie-C
More than a punctual solution I would like to expose some points that have to be considered when multithreading is applied.1. Is it really necessary? Trying to parallelize a naturally serial flow of execution is not possible. If your code is so, don't do it!2. Analyze the parts of the...
2 Jan 2014 by Sicco2
Hi,I try to parallelize sequence code in this article Steganography: Simple Implementation in C#[^]I know how to use Parallel.For, but in this case, I need return value (Bitmap object) inside the loop. There is 3 nested for and some if.Below I post both sequence and modified parallel...
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...
9 Jan 2014 by Member 10398526
Hello everybody,(I am using myLittleAdmin (for SQL Server and MSDE) v.2.0 lite r.096)I am unable to restore database from .bak file because there is no option to restore database from .bak file and when i run the Sql script in Query Analyzer i am facing the error "500 - Internal server...
5 Mar 2014 by Lakshmi munu
HiI have a table with 500,000 rows, I want to process each row, can anyone provide a sample code or even willing to pay some for it. doing for fun as I am learning C# so cannot pay a lot, but open to any conversation.contact me [EDIT email removed]