Skip to main content
-3 votes
1 answer
112 views

I am having pojo class with Lombok @data annotation. pojo classes are static in calling classes. So When I execute multiple selenium tests say test 1 and test 2, during test 2 execution, pojo fields ...
SeriousCoder's user avatar
0 votes
4 answers
171 views

I have a class that I want to make thread-safe. In it are these 2 functions : public void add(String param1, String param2) { // do something } public void clear() { // do something else } I ...
Absolute_Arthur's user avatar
-1 votes
1 answer
106 views

What is the best way to achieve following goals? Let's say, given are two synchronized functions func1 and func2 public class xyz { private Object x1 = new Object(); private boolean isWaiting = ...
sam sus's user avatar
  • 21
-1 votes
1 answer
129 views

I am trying to implement a custom HashMap for multithreading environment. Why is this giving inconsistent results? I think multiple threads are accessing the put method simultaneously. class Main{ ...
A7781's user avatar
  • 1
0 votes
1 answer
97 views

I have reviewed an implementation of map of maps in java and seen an excessive use of synchronized: public class NestedMap<K1, K2, V> { private Map<K1, Map<K2, V>> data = new ...
EthanAlef's user avatar
0 votes
2 answers
160 views

In most places, this is the implementation followed for Singleton Design Pattern. It makes use of the keyword volatile to prevent the issue of partial object creation (establishes happens-before ...
Soumya Sen's user avatar
-4 votes
1 answer
145 views

Here is my code for the problem which works fine, however, when I change the while statement right under synchronized statement, it seems any thread that get the lock after notifyall() just continue ...
cokkiePlay's user avatar
0 votes
1 answer
368 views

When testing the performance of Rocksdb with multiple column families using YCSB, I used four clients to load workloads on Rocksdb and wrote a script to execute four commands in parallel. The content ...
Niuniuniu14's user avatar
1 vote
1 answer
67 views

When running the following code: import java.util.Collections; import java.util.Map; import java.util.TreeMap; public final class ThreadTest { int N = 4; Map<Integer, Proxy> proxy = ...
mike_uvw's user avatar
-2 votes
1 answer
43 views

What code must to do: execute Bot#run synchronous. What need to fix: sharing resource (Bot.responseData or.. more) between other bots and threads. Bot.run() execution stages: http request -> ...
IndependenceCR's user avatar
2 votes
3 answers
194 views

I am modifying some concurrent code at work and recently read through Java's docs on Intrinsic Locks and Synchronization. Given that every object has an intrinsic lock, why would I ever create a ...
BurgeoningApe's user avatar
0 votes
1 answer
26 views

When I synchronize tsfile from Apache IoTDB server A to server B through pipe, how to verify the synchronization results, and how to know whether the synchronization is successful? What result ...
Monster Zhang's user avatar
0 votes
1 answer
65 views

I have a simple class which does not behave as expected. I'd like to point out that this class is the whole application. I'll show the code, the output, and then ask my question. import java.awt.Image;...
inor's user avatar
  • 2,876
-1 votes
1 answer
93 views

Things to Note: I use JetBrain IntelliJ IDEA Community Edition. My code relies on 3 short classes. Easy to read. The original code runs as it is and produces the appropriate result. See image at ...
Coding Noob Unfiltered's user avatar
1 vote
1 answer
95 views

As known that List is not thread-safe, I add synchronized to the code in 2 methods shown below. 1. public class TestSyn { public static void main( String[] args ) throws InterruptedException { ...
liuzx's user avatar
  • 31

15 30 50 per page
1
2 3 4 5
126