Skip to main content
The 2024 Developer Survey results are live! See the results

All Questions

Tagged with
-1 votes
0 answers
46 views

How to process a (near) infinite list in Java?

I am using an object storage provider that does not implement a recursive delete. When someone comes in and asks to delete a bucket, I have to manually empty the bucket. I basically have two methods ...
Dave's user avatar
  • 841
1 vote
0 answers
12 views

Modifying object outside RxJava stream

Is it correct to modify object inside reactive flow, when it was defined outside of it? Example: public Single<MyDto> createDto() { MyDto dto = new MyDto(); return Single.just(“...
Serhio's user avatar
  • 33
1 vote
1 answer
88 views

Java concurrency problem by multi-thread not occured and automatically synchronized

I’m trying to test a multi-threaded concurrency problem. What I expected is that the result should be less than 0 (not always but sometimes), because it is not synchronized. Notice the pair of println ...
MangKyu's user avatar
  • 51
-1 votes
0 answers
18 views

Keycloak concurrency issue while updating roles of a user after authentication with external server

I'm facing an issue with Keycloak while using an external user storage provider. The problem occurs when the same user tries to log in concurrently on multiple devices. Here are the details: Scenario: ...
Niranjan Raghu's user avatar
-1 votes
1 answer
50 views

Using AtomicInteger as counter for List [closed]

I am learning multi threading. I have below code which implements round robin algorithm over an CopyOnWriteArrayList. List will always have a fixed number of elements let's suppose 10. ...
Ahmed Bilal's user avatar
1 vote
1 answer
42 views

Java CopyOnWriteArrayList add element if not exists already

I have an CopyOnWriteArrayList as my code should be thread safe. List friuts = new CopyOnWriteArrayList<>(); I don't want to have duplicate friuts in list I cannot use Set as I want to have ...
Ahmed Bilal's user avatar
1 vote
1 answer
73 views

Multithreaded program not running as expected

I was trying to learn about semaphores, reading The Little Book of Semaphores by Allen B. Downey. In that there is a puzzle: Generalize the rendezvous solution. Every thread should run the following ...
ishaank10's user avatar
-1 votes
1 answer
49 views

Is it thread-safe by default to have nested CopyOnWriteArrayList?

Lets imagine I have the following code: class ClassA { final Integer i; final String; final CopyOnWriteArrayList<ClassB> l; ClassA() { ... } } class ClassB { final ...
Elektor's user avatar
  • 81
-1 votes
0 answers
19 views

Exception in HostObject::get for prop 'UIManager': java.util.ConcurrentModificationException - React Native

In our react native app (developed via expo with a custom dev client) we are encountering a problem. Some users have told us that very often the app crashes the first time it is launched on Android. ...
Niccolò Caselli's user avatar
0 votes
0 answers
40 views

Concurrency and Multi-threading

How can one implement a custom ReadWriteLock in Java that allows a thread to upgrade a read lock to a write lock without risking deadlock?
Ranushka Lakmal Sankalpa's user avatar
0 votes
1 answer
30 views

message-driven-channel-adapter - concurrent processing of messages

Issue We have a legacy application with the following message-driven-channel-adapter configuration <jms:message-driven-channel-adapter id="processRequest" destination=&...
Vijaykumar Arumugam's user avatar
-1 votes
0 answers
52 views

Non blocking Processbuilder output

When using ProcessBuilder, is there a true non blocking reactive way to consume the output? By true non blocking i mean not creating a thread that is blocked waiting to read, but push-based like ...
dac1n's user avatar
  • 389
0 votes
0 answers
24 views

Adding Thread.sleep in spring boot web app adding delays to subsequent requests [duplicate]

@RestController public class HomeController { @GetMapping("/") public String greet() throws InterruptedException { System.out.println(Thread.currentThread().getName()); ...
Balaji R's user avatar
0 votes
1 answer
124 views

Is this ThreadPool implementation correct?

I am new to concurrent coding and trying to implement simple ThreadPool by myself. I found this implementation on a learning website(jenkov.com) and it seems to be working fine. However, I think ...
Siddharth's user avatar
  • 111
0 votes
1 answer
38 views

Hazelcast race condition?

We run a Hazelcast cluster of 3 machines, each having the same instance of a process. They share amongst others an IMap named waitingMap. In the method activateAnotherBatch() we check for emptiness of ...
eddy's user avatar
  • 81

15 30 50 per page
1
2 3 4 5
600