2
votes
1answer
49 views

What's the best strategy to crawl very big filesystem? [on hold]

I need to get the owner for about 100,000,000 windows network files distributed amongst several shares. I'am using advapi32 GetNamedSecurityInfo function from within C# code, but it's a long running ...
204
votes
13answers
37k views

Concurrency vs Parallelism - What is the difference?

Concurrency vs Parallelism - What is the difference? Any examples
8
votes
3answers
820 views

Using a semaphore inside a nested Java 8 parallel stream action may DEADLOCK. Is this a bug?

Consider the following situation: We are using a Java 8 parallel stream to perform a parallel forEach loop, e.g., IntStream.range(0,20).parallel().forEach(i -> { /* work done here */}) The ...
0
votes
2answers
44 views

Parallel search of distinct values?

Consider the following code : // Preprocessor #include <iostream> #include <chrono> #include <thread> #include <algorithm> #include <mutex> #include <random> // ...
1
vote
0answers
158 views

Infinispan embedded cache mode - Parallel execution Fails - concurrent.ExecutionException

I'm running Infinispan in the embedded mode using the map reduce framework in one of my batch application. If the 2 clients invoke the batch at same time, this parallel execution causes following ...
2
votes
2answers
98 views

Reduction behaves strangely when using parallel stream but works fine for sequential stream in Java 8u5

class Foo{ int len; } public class Main { public static void main(String[] args) throws Exception{ System.out.println(Stream.of("alpha", "beta", "gamma", "delta").parallel().reduce( ...
0
votes
1answer
46 views

Java: Estimate available HW parallelism howto

I keep on with fork/join optimization, (or to be more precise with optimization of dividing input between threads). And faced the next statement (pg. 73): Final parallelism speedup depends on: ...
12
votes
6answers
69 views

How to achieve multitasking in a microcontroller?

I wrote a program for a wrist watch utilizing a 8051 micro-controller using Embedded (C). There are a total of 6 7-segment displays as such: _______________________ | | | ...
4
votes
2answers
451 views

Nested Java 8 parallel forEach loop perform poor. Is this behavior expected?

Note: I already addressed this problem in another SO post - Using a semaphore inside a nested Java 8 parallel stream action may DEADLOCK. Is this a bug? -, but the title of this post suggested that ...
54
votes
5answers
19k views

Coordinating parallel execution in node.js

The event-driven programming model of node.js makes it somewhat tricky to coordinate the program flow. Simple sequential execution gets turned into nested callbacks, which is easy enough (though a ...
0
votes
2answers
57 views

'Concurrency' vs 'Parallelism' — 'Threads' vs 'Processes'

I do know the difference between concurrency (CPU process swapping) and parallelism (processes running in real-time parallel on multiple cores). What I wish to know is what role threads and processes ...
0
votes
1answer
33 views

Parallel Programming Clarification and Concurrent Programming

I've been reading up on parallel and concurrent programming, and there are two things that I still have not found answers to and still confused about. 1) In some places I read that parallel ...
0
votes
1answer
53 views

How to parallel nested loop to find the nearest two point in OpenMP? [duplicate]

I have a 2D matrix X,X[i][j] means the distance between point i and j.Following code is to find the nearest two point according to their cosine distance in nested loop: //m,n is the rows,columns of X ...
2
votes
1answer
29 views

parallel DB requests to Couchbase from Node.js SDK

I am hoping to fire off several Get requests to Couchbase store in a short time span, say in a half a millisecond. I can't use a multiGet because I don't have all the keys at the same time. However, ...
0
votes
4answers
63 views

Why arent the threads running concurrently?

I am running a very simple multi thread program Main program package javathread; public class JavaThread { public static void main(String[] args) { JThread t1 = new ...
0
votes
0answers
39 views

Concurrent matrix sum - past Exam paper

I'm currently studying in my 3rd year of university - my exam for Computer Systems and Concurrency and I'm confused about a past paper question. Nobody - even the lecturer - has answered my question. ...
3
votes
2answers
36 views

Concurrent Programming act on each element in array

I have a question whch related to parallel programming. If I have a program that acts on each and every elemnt of an array why might it not be advantagous to use all the available processors? I was ...
39
votes
4answers
2k views

Why is there no implicit parallelism in Haskell?

Haskell is functional and pure, so basically it has all the properties needed for a compiler to be able to tackle implicit parallelism. Consider this trivial example: f = do a <- Just 1 b ...
2
votes
1answer
99 views

How to (globally) replace the common thread pool backend of Java parallel streams?

I would like to globally replace the common thread pool used by default by the Java parallel streams, i.e., for example for IntStream.range(0,100).parallel().forEach(i -> { doWork(); }); I ...
0
votes
1answer
35 views

Capture Total Execution time of a parallel thread

I am using java.util.concurrent.Executors and java.util.concurrent.ExecutorService to execute parallel threads. Please let me know how to capture Time taken for complete all threads. import ...
0
votes
1answer
36 views

ConcurrentDictionnary tryAdd

When you are using ConcurrentDictionary and trying to add new key pairs to it using TryAdd it checks whether value exists and then add if not. Is there any way I can add duplicate keys wit different ...
3
votes
2answers
220 views

Traverse a graph in parallel

I'm revising for an exam (still) and have come across a question (posted below) that has me stumped. I think, in summary, the question is asking "Think of any_old_process that has to traverse a graph ...
2
votes
1answer
1k views

Java parallel processes with fork

I was wondering if it was possible in Java to create multiple processes (yes, processes, not threads) to do some parallel works. For example, to calculate the surface of five squares, but that ...
0
votes
1answer
39 views

Difference between multi-core and hyper threading

I am trying to understand explicit parallelism in processors, but confused about how multi core processors(having multiple cores on a single chip) are different in concept from symmetric ...
3
votes
2answers
3k views

Can we run multi-threads in parallel in Ruby?

Please let me know if there is a way to run multi-threads in parallel. What I know till now is that Ruby has a global interpreter lock or global VM lock which blocks threads to run in parallel and ...
8
votes
5answers
4k views

How start identical jobs with different parameters in parallel execution?

I have a build job and a test job parameters. I want to be after the build job, simultaneously run test job with one parameter and the same test job with different parameters in parallel execution. ...
0
votes
3answers
36 views

How to remove entities from context concurrently?

Assume we have a List of entities to be removed: var items = this.itemRepository.GetRange(1, 1000).ToList(); Instead of simple loop to delete items, I want to remove them concurrently like this: ...
1
vote
1answer
52 views

Ordering data from multiple processes in Erlang

I am making a program that categorises ID numbers into Rooms and Groups. I'm trying to order some output from multiple parallel processes but the output is coming out like this {'C003','Group A',1} ...
2
votes
1answer
62 views

Task.WhenAll result ordering

I understand from here that the task execution order for Task.Whenall is not deterministic but I cannot find any information about result order. Will the results collection contain the results in ...
0
votes
1answer
50 views

Maintaining FIFO when using threads in Java

I am attempting to perform an expensive and variable length task on elements received in a sequential manner. It is imperative that element order is maintained while still processing each element ...
0
votes
1answer
79 views

Scala Future Composition Kerfuffle

I've got the following method that retrieves from cache, or RESTfull API if it's a cache miss. I am having to use a flatMap so that I get a consistent interface. Having to wrap the result of a cache ...
0
votes
0answers
92 views

Concurrent and Parallel Logic Programming

In the introduction to The Art of Prolog, Sterling and Shapiro defer a discussion of parallelism, concurrency, and logic programming to another book. My question is whether there is such a resource: ...
0
votes
1answer
36 views

Parallelize a dictionary comprehension in python

Say I have a dictionary comprehension that looks like grid = {z: g for (z,g) in grid.iteritems() if abs(next(g)) < 2} What's the most pythonic way to parallelize this operation? Would python ...
1
vote
2answers
77 views

UML Statecharts or state machine in parallel region

I'm now looking for a book mainly focusing on UML statecharts in parallel region. It's pretty hard to find one. Most of the book only contain so little information and I wonder whether there is a book ...
0
votes
1answer
26 views

Scala - Running Two Functions in Parallel

I have two functions (f : Unit => T, g : Unit => U) for some types T, U. I want to run these two functions in parallel (equivalently on different threads). I want the main thread to wait for the ...
0
votes
2answers
46 views

Get threads are held for locking a mutex

I just wondered how would I get(count) the threads are held for locking a mutex, for example considering the following example void _foo(void* arg){ pthread_mutex_lock(&_lock);//[ABC] //doing ...
5
votes
1answer
289 views

Moving execution from one thread to another to implement task parallelism and call-by-future

I'm trying to implement a call-by-future mechanism in C++. Although this is just a test code (made in a bit of a hurry), I intend to use something similar for the runtime of a language I'm working on ...
11
votes
3answers
825 views

Java 8 Collections concurrent processing

I am planning to do an internal presentation in my company on new features and concepts in Java 8. What I would like to focus is on the parallel processing capabilities of new collection libraries. ...
2
votes
1answer
682 views

Using .NET (3.5) Task Parallel Library in C++/ CLI

Well, I download Reactive Extensions for NET 3.5 to use it in visual studio 2008 with c++/cli... But all Task Parallel Library examples are in C#...I can not able to figure out EVEN converting that ...
0
votes
3answers
64 views

Executing code in parallel in Java

I have this very basic script which performs a Redis server request but I do not understand multithreading enough as to successfully make it run in parellel. This is what I have in my main() method ...
0
votes
1answer
34 views

Checking and controlling number of application's threads that actually run in parallel

Let's say I have Java application that spawns and starts N threads. I run it on Linux or Windows machine with 4 cores. I would assume, that if my app creates bunch of threads, at any time 4 of them ...
92
votes
9answers
21k views

Difference between concurrent programming and parallel programming

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 ...
3
votes
1answer
65 views

Erlang message receiving order

With the knowledge of these facts about time-order of Erlang message passing behaviour: If process A sends two messages to process B, then the two messages are guaranteed to arrive in the order ...
2
votes
3answers
151 views

Calculating the number of primes in a range RMI version vs concurrent version

I have two versions of a program with the same purpose: to calculate how many prime numbers there are between 0 and n. The first version uses concurrency, a Callable class "does the math" and the ...
1
vote
1answer
138 views

MPI sending messages with MPI_Send and MPI_Reduce

so I am learning about parallel programming and am writing a program to calculate a global sum of a list of numbers. The list is split up into several sublists (depending on how many cores I have), ...
1
vote
2answers
64 views

Shared resources with channels in google go

I am taking a look at the Google Go language as I am building a realtime system, and I find the sharing of resources through channels a bit confusing. I'm trying for the sake of understanding, to let ...
1
vote
2answers
91 views

Defining functions in C++AMP

I am trying to write a convolution filter which uses a specific function to determine the exact output color of the pixel. Does anybody know if it is possible to define a function which can be used in ...
1
vote
1answer
53 views

Behavior of operator[] on 1D and 2D arrays in C++ AMP.

I've enocuntered a very strange exception when writting code in C++Amp. I define two concurrency::array objects as follows: concurrency::array<float, 2> img_amp_data(11, 11, ...
2
votes
1answer
376 views

Why do my threads not run in parallel using Java ExecutorService?

public class Test { private ExecutorService executor = Executors.newFixedThreadPool(50); public void startTenThreads() { for (int i = 0; i < 10; i++) { ...
0
votes
2answers
72 views

Parallel execution and termination of multiple threads

I have a simple application in which I create 3 threads inside a class to ping 3 different websites and note the time taken to do so. I wish to enhance it by seeing which thread out of the 3 executes ...