parallel

How can Perl share global variables in parallel processing?

use Parallel::ForkManager; use LWP::Simple; my $pm=new Parallel::ForkManager(10); our $a =0; @LINK=( 10,203, 20, 20 ,20 ,10 ,101 ,01 ,10 ) ; for my $link (@LINK) { $pm->start and next; my $lo = ($link * 120.22 )*12121.2121212121212121*( 12121212.1212121+ $link); $a = $a+ $lo ; print $a."\n" ; $pm->finis...

Can variable which is declared in same procedure body where tasks are be considered as shared for these tasks?

Variable is used in 1 task only, but the question is: can it be CALLED shared? ...

How to parllelize this, using OPENMP sections

Hi, I have this function which i want to parallelize using openmp sections. I broke the function into various sections and applied #pragma omp sections but it gives segmentation fault. Can somebody please explain why and a solution to it. Should i use some clause with sections. Which one and how please. /*! ****************************...

DirectShow on multiple machines with wcf

Is it any how possible to run DirectShow on multiple machines with wcf? ...

Parallel "insertions" into a binary trie in Haskell

I have a list of n-bit "words" type BitWord = [Bool] and a trie which stores the word from the top to bottom: data Tree = Bs Tree Tree -- Bs (zero_bit) (one_bit) | X -- incomplete word | B -- final bit of word I have a function: seenPreviously :: BitWord -> Tree -> (Tree,Bool) The function steps through the ...

Best practices for writing parallel unit tests

I'm looking into using parallel unit tests for our project(s) and was wondering about any best practices for actually writing such parallel unit tests. ...

How can I run Test::Perl::Critic in parallel?

I've written a simple test case based on Test::Perl::Critic which runs critic on every single source file in the repository (all_critic_ok). However, this test takes a long time, especially since I also use a Perl::Tidy policy. Normally, criticizing different files is not dependent on other critics, so I thought I could parallelize tho...

how can I iterate through two lists in parallel in Python?

Possible Duplicates: Iterate a list as tuples in python How do I iterate over the tuples of the items of two or more lists in Python? I have two iterables in Python and I want to go over them in pairs: foo = (1,2,3) bar = (4,5,6) for (f,b) in some_iterator(foo, bar): print "f: ", f ,"; b: ", b should result in: f: 1; ...

Sorting a 3 parallel list that includes strings and numeric value in Python

how to sort using 3 parallel array lists: num1 = ['a','b','c,'] num2 = ['apple','pear','grapes'] num3 = [2.5,4.0,.68] I used 2 for statements followed by a if statement. Sorting by elements the output should be: a apple 2.5 b pear 4.0 c grapes .68 unfortunately, I am having issues with sorting the 3rd n...

minimum work size of a goroutine

Does anyone know approximately what the minimum work size is needed in order for a goroutine to be beneficial (assuming that there are free cores for the work to be offloaded to)? ...

C# 4.0 AsParallel() UnAuthorizedAccessException when accessing the file system

I am using the C# 4.0 AsParallel() extension method and getting an UnAuthorizedAccessException when accessing the file system foreach (var item in items.AsParallel()) { File.Open(@"c:\file.txt"); } ...

When should you not use the new parallel loop functions in c#

For maintainability purposes, my impulse is to simply use parallel processing all the time. For simple loops it sounds like there is overhead which could actually slow the function, and presumably for loops where order of execution makes a difference it is a mistake. How do you decide when to use parallel processing and when to avoid i...

Is there any circumstance in which calling EnterWriteLock on a ReaderWriterLockSlim should enter a Read lock instead?

I have a seemingly very simple case where I'm using System.Threading.ReaderWriterLockSlim in the 3.5 version of the .NET Framework. I first declare one, as shown here: I put a break point right before the lock is acquired and took a screen shot so you can see (in the watch window) that there are currently no locks held: Then, ...

Running NUnit Tests in parallell using NANT

Hi, We have different categories of tests under various assemblies. What is the best possible way to run them in parallel? I am aware of a task in ant, is there any such task in NANT? Kind regards, ...

Log4Net and logging from parallel instances

Hi. I'm using log4net in my project and there is one problem. The major function of the program takes a long time and I use logging to save information about it. I use FileAppender for saving log to file. My application is on the shared(local) folder and there could be several instances of the application running from one path. In this...

Does lock allocate

I read somewhere, although I can't remember where, that using the lock keyword in C# can allocate. I know that trying to lock a ValueType will box the valuetype, but are there any other situations? EDIT:: Everyone seems to be answer the valuetype case, I already know this! I also know what locks are and how to use them in great depth...

Multithreading Puzzles

I'm trying to come up with some programming puzzles focused on multi-threading. Most of the problems I've been able to come up with, so far, have been pretty domain specific. Does anybody have any decent programming puzzles for developers attempting to learn the core concepts of multi-threading applications? ...

Difference between concurrent programming and parallel programming

Hi all I have a question: what is the difference between concurrent programming and parallel programing? I asked google but didn't find anything that helped me to understand that difference. Could you give me an example for both? For now I found this explanation: http://www.linux-mag.com/id/7411 - but "concurrency is a property of the ...

make output parallel with php code based

Hi all, I need your some help... How to create parallel output from many pages in one pages, see examples: I store all data in plain text e.g. old-book-version.txt 1:1 dadidedodu.... 1:2 cacecocuci.... 2:1 papopupepi.... 2:2 lalilolule.... 2:3 and more...... mid-book-version.txt 1:1 dedadodedu.... 1:2 cacicecuca.... 2:1 popapepupi......

Memory Usage in Foreach Function

I was wondering if there is any way to get the foreach package in R to use a pre-allocated structure to put results. basically it involves lots of small linalg operations on very big data sets. My non-foreach original code is something like results <- rep(NA,m*l*[big.number]) dim(results) <- c(m,l,[big.number]) for (i in 1:m){ for ...