-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
new map creation in multiple threads throws java.util.NoSuchElementException #34
Comments
Please try to synchronize map creation externally, for example, extract a |
Yes, that solves the issue. |
I'll publish version with a fix tomorrow -- please check then. |
@leventov thanks .. it works ! |
I have 0.6.6 and still get this error, both in the java 7 and java 8 versions. Specifically, I have a function: private static synchronized HashCharCharMapFactory getHashCharCharMapFactory() { |
@athawk81 please check you have |
@leventov I am still seeing this issue (or one similar to it) when using version 0.6.8 with Java 8:
I have followed the advice in this thread to create the set (or map -- seeing the same issue when using the factory for map creation) in a static, synchronized method, but no luck. Please let me know if I should open another issue or if you need any additional information. |
@jdpgrailsdev the synchronization issue has been solved -- you shouldn't create a Set in a synchronized block. Please check that you have both <dependencies>
<dependency>
<groupId>net.openhft</groupId>
<artifactId>koloboke-api-jdk8</artifactId>
<version>0.6.8</version>
</dependency>
<dependency>
<groupId>net.openhft</groupId>
<artifactId>koloboke-impl-jdk8</artifactId>
<version>0.6.8</version>
</dependency>
<dependencies> |
@leventov
I tried going back to creating the map/set in a non-synchronized fashion, but I still get the same error:
Here is an example of how I am creating the map:
Previously, the |
Exception in thread "pool-1-thread-1" java.util.NoSuchElementException
at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:340)
at java.util.ServiceLoader$1.next(ServiceLoader.java:428)
at net.openhft.koloboke.collect.map.hash.HashIntDoubleMaps.getDefaultFactory(HashIntDoubleMaps.java:56)
at net.openhft.koloboke.collect.map.hash.HashIntDoubleMaps.newMutableMap(HashIntDoubleMaps.java:81)
at Test.run(Test.java:18)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:695)
The text was updated successfully, but these errors were encountered: