FAQ Database Discussion Community


Haskell, Channels, STM, -threaded, Message Passing

haskell,concurrent-programming,stm
I am trying to use channels/STM to implement message passing in Haskell. Maybe this is a terrible idea, and there is a better way to implement/use message passing in Haskell. If this is the case, do let me know; however, my quest has opened some basic questions on concurrent Haskell....

Java- Why this program not throwing concurrent Modification exception

java,multithreading,concurrent-programming
I am trying to induce a concurrent modification exception by accessing a HashMap instance variable reference, but this program is not throwing the error. Appreciate if you could help me to understand. package Threads; import java.util.HashMap; public class ProducerConsumer { private HashMap<String, String> sharedMap = new HashMap<String,String>(); public void putMethod(){...

Two-Lock Concurrent Queue Algorithm implementation issue

c,multithreading,algorithm,pthreads,concurrent-programming
I was going through the paper of Michael and Scott for Non-Blocking Concurrent Queue Algorithm and Two-Lock Concurrent Queue Algorithm. They have mentioned in the paper that C code for the tested algorithms can be ob- tained from ftp://ftp.cs.rochester.edu/pub/ packages/sched conscious synch/concurrent queues. But since the paper is very old...

java model client server architecture with lock on resources

java,client-server,java.util.concurrent,concurrent-programming
I have to develop a client server architecture with Java (server side), but I need some advice. Situation: a server that exposes an action decrementValue the server has a variable called Value = integer value some clients can send a decrementValue request to the server server, for each requests, do:...

Why this simple program on shared variable does not scale? (no lock)

multithreading,concurrency,pthreads,concurrent-programming,pthread-join
I'm new to concurrent programming. I implement a CPU intensive work and measure how much speedup I could gain. However, I cannot get any speedup as I increase #threads. The program does the following task: There's a shared counter to count from 1 to 1000001. Each thread does the following...