concurrent-programming

What is this new Axum programming language?

I read this story on slashdot today where they announce a new parallel programming language by Microsoft. What is this new programming language about? It says Parallel Programming. But is it going to be an alternative/replacement for MPI, PVM, OpenMP and similar parallel libraries/frameworks? Any thoughts? ...

.NET Asynchronous stream read/write

Hi, folks. I would really appreciate to have your help on the following issue: I have been trying to solve this "Concurrent Programming" exam exercise (in C#): Knowing that Stream class contains int Read(byte[] buffer, int offset, int size) and void Write(byte[] buffer, int offset, int size) methods, implement in C# the NetToFile me...

How to stop the execution of Executor ThreadPool in java?

Hi, I am working on the Executors in java to concurrently run more threads at a time. I have a set of Runnable Objects and i assign it to the Exceutors.The Executor is working fine and every thing is fine.But after all the tasks are executed in the pool ,the java program is not terminated,i think the Executor takes some time to kill the...

Why Clojure instead of Java for concurrent programming

When Java is providing the capabilities for concurrent programming, what are the major advantages in using Clojure (instead of Java)? ...

Multi-threaded application interaction with logger thread

Hi there, folks. Here I am again with questions about multi-threading and an exercise of my Concurrent Programming class. I have a multi-threaded server - implemented using .NET Asynchronous Programming Model - with GET (download) and PUT (upload) file services. This part is done and tested. It happens that the statement of the proble...

Strategy in java to clean up / remove unused map elements

Hi, I'm implementing a "manager" in my web app that can be called to set and get which web site context the current thread is in (we white label our site so the web site context represents which site we're on) I'm trying to work out what the best strategy to do this, currently I'm implementing the store of Threads to WebSiteContexts...

why doesn't this erlang code work???

fib(N)-> P1 = spawn(fun concFib:conFib/0), P2 = spawn(fun concFib:conFib/0), X=rpc(P1,N-2),Y=rpc(P2,N-1),X+Y. conFib()-> receive {Client,N} -> Client ! regfib(N) end. rpc(Pid,Request)-> case erlang:is_process_alive(Pid) of true -> begin ...

PHP Loop Performance Optimization

I am writing a PHP function that will need to loop over an array of pointers and for each item, pull in that data (be it from a MySQL database or flat file). Would anyone have any ideas of optimizing this as there could potentially be thousands and thousands of iterations? My first idea was to have a static array of cached data that I w...

How to explain the "deadlock" better?

I am struggling to explain "deadlock" in threads in easy words, so please help. What could be the best example of "deadlock" (say, in Java), and how it does happen in steps and how to prevent it? But without getting into details too deep. I know that's like asking two opposite things, but still. If you have any previous concurrent progra...

Is parallel programming == multithread programming ?

Is parallel programming == multithread programming? ...

Efficient algorithm to distribute work?

It's a bit complicated to explain but here we go. Basically, the issue is "How to break up problems into subproblems in an efficient way". "Efficient" here means, the broken up subproblems are as big as possible. Basically, it would be ideal if I don't have to break up the problems at all. However, because an worker can only work on spec...

Multiple threads or process with threads

Hi, this is for an assignment so I'm not looking for code. I have to simulate a game where each player has turns and needs to 'pay attention' to what's going on. So far, i know I'll need two threads for each player, one that will sleep until the player's turn and the other paying attention. My question is: Should I work each player as...

STL algorithms and concurrent programming

Hello everyone, Can any of STL algorithms/container operations like std::fill, std::transform be executed in parallel if I enable OpenMP for my compiler? I am working with MSVC 2008 at the moment. Or maybe there are other ways to make it concurrent? Thanks. ...

How to use IObservable/IObserver with ConcurrentQueue or ConcurrentStack

I realized that when I am trying to process items in a concurrent queue using multiple threads while multiple threads can be putting items into it, the ideal solution would be to use the Reactive Extensions with the Concurrent data structures. My original question is at: http://stackoverflow.com/questions/2997797/while-using-concurrent...

What are the tradeoffs when generating unique sequence numbers in a distributed and concurrent environment?

I am curious about the contraints and tradeoffs for generating unique sequence numbers in a distributed and concurrent environment. Imagine this: I have a system where all it does is give back an unique sequence number every time you ask it. Here is an ideal spec for such a system (constraints): Stay up under high-load. Allow as many...

Is there anyhow I can make pc camera concurrently accessible on windows?

By default subsequent references to the camera will fail if it's already in use. But is it possible to make the subsequent references read-only, but still can access the camera? ...

Java: reference escape

Read that the following code is an example of "unsafe construction" as it allows this reference to escape. I couldn't quite get how 'this' escapes. I am pretty new to the java world. Can any one help me understand this. public class ThisEscape { public ThisEscape(EventSource source) { source.registerListener( ne...

.Net 4.0 Parallel Programming - how to write data to concurrent collections?

I have a grid which is defined as: List<List<Cell>>, where "Cell" is a custom class of mine. My program has several threads which access various coordinates on the grid, and change data in the "Cell" class. But I only want one thread writing data to a "Cell" object at a time. I thought using concurrent collections such as ConcurrentBag w...

Are these thread-safe ?

I attended an interview today in which the interviewer asked me the following question : Is re-entrancy and mutual exclusion thread-safe ? Can you explain why ? I am relatively new to concurrent programming and could not answer it.. But i said ... Mutual exclusion is thread safe . But re-entrancy is not and that is the reason why we h...

branching ideas for concurent team development?

Anyone have some good pointers on how to get multiple teams doing concurrent asp.net development using Microsoft TFS? i have been using subversion for the past many years now and it allowed my team to work freely without exclusively locking files and doing auto merges when possible (like 99% of the time) but this all falls apart when m...