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 ...
Mis asked 21/7, 2011 at 12:16
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...
Burnedout asked 27/11, 2011 at 15:4
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...
Goon asked 27/1, 2010 at 1:1
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[...
Mascagni asked 19/12, 2014 at 1:39
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...
Fryd asked 6/2, 2011 at 9:44
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 ...
Idiophone asked 3/7, 2016 at 1:12
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 ...
Platina asked 6/4, 2016 at 11:4
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...
Designation asked 12/12, 2013 at 7:0
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...
Patchwork asked 11/1, 2015 at 5:14
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 ...
Foucault asked 8/7, 2010 at 7:50
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...
Amalia asked 27/10, 2014 at 15:9
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...
Buchholz asked 15/10, 2013 at 14:40
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...
Edam asked 18/12, 2012 at 17:20
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...
Cupid asked 11/3, 2013 at 14:28
1 Next >
© 2022 - 2024 — McMap. All rights reserved.