Skip to main content
Filter by
Sorted by
Tagged with
2 votes
1 answer
71 views

Given a Java ConcurrentMap, I would like to atomically: Check if an entry is contained in the map If it is present, run an action (I'm thinkng of a BiConsumer taking the key and its value) Otherwise, ...
Danilo Piazzalunga's user avatar
2 votes
1 answer
135 views

When working with JNI, can the native side obtain an _Atomic int32_t* given a Java AtomicInteger reference, and run C atomic functions on it (e.g. atomic_fetch_add)? We could call Java's methods (e.g. ...
anon's user avatar
  • 697
2 votes
0 answers
110 views

I'm using java.util.concurrent.ScheduledExcecutorService.scheduleAtFixedRate to execute a task periodically. I run it once every minute and it usually completes after 5 seconds, but occasionally runs ...
Joshua Davies's user avatar
3 votes
1 answer
87 views

I attempted to replicate the experiment about "Release/acquire" from Doug Lea‘s blog on j9mm (https://gee.cs.oswego.edu/dl/html/j9mm.html#summarysec) : volatile int ready; // Initially 0, ...
SemgHH's user avatar
  • 41
4 votes
1 answer
213 views

Im trying to create a Java App using SpringBoot 3 framework and GraphQL. I'm trying to resolve a field which depends on several dataLoaders within my App however, I seem to be running into an issue ...
maxs87's user avatar
  • 2,224
0 votes
1 answer
78 views

Edit: I've cut down Mainboard to just the relevant function to make code shorter to read. If any additional code needs to be read to help understanding, please say I'm currently making a multiplayer ...
Kyle Nickson's user avatar
-4 votes
1 answer
177 views

The class implementation below wraps two AtomicInteger fields. After the max=9999 value is reached, the main sequence number is expected to reset to zero. When the sequence number resets, the ...
Awan Biru's user avatar
  • 484
0 votes
3 answers
148 views

I have a problem regarding spring DefaultManagedTaskExecutor. We are deploying our SpringBoot 3.2.5 application to websphere Liberty and we are using Liberty ManagedExecutorService as external ...
David Černý's user avatar
0 votes
1 answer
26 views

Spring-Rabbitmq SimpleRabbitListenerContainerFactory is defined with a CustomThreadPoolExecutor. @Bean public SimpleRabbitListenerContainerFactory rabbitListenerContainerFactory(final ...
indika's user avatar
  • 945
1 vote
2 answers
195 views

From the library I use I get ConcurrentMap. I want to obtain it's keys as Set. How to do it in thread-safe way (since Kotlin collections API is thread-unsafe)?
pixel's user avatar
  • 26.8k
0 votes
0 answers
96 views

Fine, this is most probably a silly question... Is there a way to construct a StructuredTaskScope using an ExecutorService? Any idea is welcome. Best regards Alex
Alexander Schell's user avatar
1 vote
0 answers
62 views

I'm trying to write an in-memory implementation of the load balancer that will have a get() method returning the instances in a round-robin pattern, I need it to run properly in a concurrent ...
Anonymous9991's user avatar
-1 votes
2 answers
239 views

I would like to conditionally and atomically update (or set if the current is empty) an AtomicReference based on a Predicate on the current value. I was hoping that something like this existed: /** * ...
peterh's user avatar
  • 19.5k
0 votes
1 answer
117 views

It's my first post and I'm a beginner with CompletableFuture and I want to test exceptions (InterruptedException and TimeoutException) when I use CompletableFuture.get(). My code: CompletableFuture<...
Marsei's user avatar
  • 3
1 vote
1 answer
69 views

During a course on concurrent programming, I've run into this sample code: @Test void promiseTestCompose2() throws Exception { CompletableFuture<Integer> future1 = CompletableFuture ....
user avatar
0 votes
0 answers
41 views

I was trying to do some experminet with CopyOnWriteArrayList and found that when 2 threads are concurrently modifying same CopyOnWriteArrayList object, the final result changes in different run. ...
tatushar3's user avatar
  • 111
1 vote
1 answer
194 views

I'm trying to figure out, how the java.util.concurrent.DelayQueue works in the multithreaded environment. I see that this data structure uses ReentrantLock internally, and it is acquired at the ...
Fedorucho's user avatar
1 vote
1 answer
167 views

I’m developing a custom caching mechanism for my Java application to cache objects that are expensive to create (e.g., database connections). The idea is to allow concurrent access to the cache while ...
Mustafa Abudalu's user avatar
2 votes
1 answer
1k views

I have a REST endpoint in springboot which calls an external api async multiple using CompleteableFuture. The external api is called using resttemplate in Completeablefuture.supplyAsync(() => ...
Aditi's user avatar
  • 65
0 votes
0 answers
38 views

Help me understand the work with the database, on the 3-5 iteration, data is incorrectly written to the database in the lemma table, the site is correctly recorded, the page is also, but when lemma ...
Ivan Kazantsev's user avatar
-1 votes
1 answer
1k views

I'm trying to play with async java in my intellij local. My intention is that i will call calucalateAsync() method from main method and then put the debug point on System.out.println("calculate ...
vinter's user avatar
  • 520
0 votes
1 answer
76 views

I have a use-case where I need to hit an endpoint to fetch some data. The endpoint takes start-date-time and end-date-time as params and has a limitation that the duration between them can only be <...
mysteryFruit's user avatar
0 votes
2 answers
369 views

In my Android app I want to use java.util.concurrent tools to make operations that return value (for educational purposes). I read that CompletableFuture can be used for this. I made a project where I ...
faritowich's user avatar
0 votes
1 answer
127 views

Consider the following code class Test { public void method1() { CompletableFuture<String> future = helloFuture(); assertEquals("done", future.get()); } } class Service { ...
Abe's user avatar
  • 9,141
3 votes
1 answer
146 views

I have overridden the execute method for java.util.concurrent.Executor in ThreadPoolExecutor implementation. The new implementation just decorates the runnable and then calls the original execute. The ...
nluk's user avatar
  • 754

1
2 3 4 5
29