concurrent-programming Questions

4

Solved

Is it possible to perform an asynchronous wait (read : non-blocking) on a conditional variable in boost::asio ? if it isn't directly supported any hints on implementing it would be appreciated. I ...

5

Solved

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 he...
Evvoia asked 14/9, 2010 at 0:49

8

Solved

I can see how a "standard" Semaphore Class can be implemented in Java. However, I cant see how to implement a Binary Semaphore Class in Java. How does such implementation work? When should I call t...

15

Solved

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? B...

3

Solved

I was trying to check how Go will perform with 100,000 goroutines. I wrote a simple program to spawn that many routines which does nothing but print some announcements. I restricted the MaxStack si...
Customhouse asked 11/3, 2014 at 13:12

7

Solved

I have the following situation: I have 2 JVM processes (really 2 java processes running separately, not 2 threads) running on a local machine. Let's call them ProcessA an ProcessB. I want them to...
Godfree asked 8/6, 2012 at 2:39

4

Solved

I have heard Java 8 provides a lot of utilities regarding concurrent computing. Therefore I am wondering what is the simplest way to parallelise the given for loop? public static void main(String[...

8

Solved

Is there a Mutex object in java or a way to create one? I am asking because a Semaphore object initialized with 1 permit does not help me. Think of this case: try { semaphore.acquire(); //do stu...
Prochronism asked 13/3, 2011 at 17:22

4

my question is, whether there exists a framework in Java for managing and concurrently running Tasks that have logical dependencies. My Task is as follows: I have a lot of independent tasks (Let's...

3

Solved

This may be a duplicate question, but I've found this part of code in a book about concurrency. This is said to be thread-safe: ConcurrentHashMap<String, Integer> counts = new ...; private ...

1

Solved

Recently I read some examples from the Chapter 8 of the The Art of Multiprocessor Programming, about “Monitors and Blocking Synchronization” that use the signalAll() of a Condition object, without ...

6

How do I steal 2 MSBs from an address to do an atomic operation? I'm trying to do a single word CAS An example public class Node { long key; long value; Node lchild; // format is flag1,flag2,a...

1

Solved

How React PHP handles async non-blocking I/O ? Nodejs uses its event queue which handles I/O on different threads. It uses libuv for this. As in PHP there isn't something like that, How React hand...
Leventis asked 16/6, 2015 at 9:27

1

Solved

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, d...
Tideland asked 20/5, 2015 at 4:15

2

Solved

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 understa...
Steady asked 30/4, 2015 at 11:0

2

Solved

I have a situation where I am making several (say four) ajax calls (using AngularJS http get, if that matters) and I want each call to callback and increment a counter, so I can know when all (four...

2

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 ...

2

Solved

I am running a function for several sets of iterables, returning a list of all results as soon as all processes are finished. def fct(variable1, variable2): # do an operation that does not neces...

1

I've never done something on concurrent programming.What I know about them is only from OS books. And I met this question on an interview today. I wonder if anybody can give me an intuitiv...
Ekaterinodar asked 12/11, 2013 at 11:44

3

I found it in many references which mention that volatile in C/C++ is is weak and may cause issue in concurrent environment on multiple processor, but it (volatile) can be used as communication mec...
Mastery asked 12/11, 2013 at 7:31

2

Solved

Just playing around with concurrency in my spare time, and wanted to try preventing torn reads without using locks on the reader side so concurrent readers don't interfere with each other. The ide...
Strikebound asked 21/9, 2013 at 18:14

2

Solved

I have to ensure while iterating the Vector; there is no update on that Vector to avoid ConcurrentModificationException. I can use concurrent collection. But i just want to give a try on Vector. Be...

2

Solved

I'm only using this code for an example. Assume I have the following Person class. using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace dictionaryDispla...
Avouch asked 21/7, 2013 at 20:9

2

Solved

I found that the write lock of the ReentrantReadWriteLock provides an isHeldByCurrentThread() method to check whether the invoking thread holds that lock. But there is no corresponding isHeldByCur...

1

Solved

Is the following correct? The disruptor pattern has better parallel performance and scalability if each entry has to be processed in multiple ways (io operations or annotations), since that can b...

© 2022 - 2024 — McMap. All rights reserved.