Closed acuna-public closed 7 months ago
We haven't found a benefit on Windows as we have on Linux with isolated CPUs, so it is probably better to disable this for now.
I'm currently having the same issue, @acuna-public. Did you have any lucky solving this?
huguera10 oh, hi, I'm so sorry for forget to answer, I found out that Java threads are multicore out of the box, so the reason I've tried the side solutions for this is my wrong application approach: you need to do needed actions exactly in every thread, for example if you have four threads which you're using in ExecutorService for example, and you need to use the database - you need to open new connection in every thread (4 threads - 4 database connections). You can use global properties, but which store limited data types (strings, numbers etc.) but if you need to work with resources (databases, files, http etc.) - you need to work with it exactly in every thread, so you need to simply use your task manager to check if all your cores is working when your script is working (you can start it in infinite loop for test), if it not - you need to check your application structure and check it again.
Trying it in Windows 7 (but I don't think it depends) on i5-4430 giving me this warnings:
[bg] INFO net.openhft.affinity.AffinityLock - Assigning cpu 3 to Thread[bg,5,main] on thread id 2548 [bg] WARN net.openhft.affinity.impl.WindowsJNAAffinity - Tried to set affinity to {3} but was {0, 1, 2, 3} you may have in sufficient access rights [bg-2] WARN net.openhft.affinity.LockInventory - Unable to acquire lock on CPU 3 for thread Thread[bg-2,5,main], trying to find another CPU [bg] INFO net.openhft.affinity.AffinityLock - Assigning cpu 1 to Thread[bg,5,main] on thread id 2548 [bg-2] INFO net.openhft.affinity.AffinityLock - Assigning cpu 2 to Thread[bg-2,5,main] on thread id 6512 [bg] WARN net.openhft.affinity.impl.WindowsJNAAffinity - Tried to set affinity to {1} but was {0, 1, 2, 3} you may have in sufficient access rights [bg-2] WARN net.openhft.affinity.impl.WindowsJNAAffinity - Tried to set affinity to {2} but was {0, 1, 2, 3} you may have in sufficient access rights [bg-2] WARN net.openhft.affinity.LockInventory - No reservable CPU for Thread[bg-2,5,main] [bg-3] WARN net.openhft.affinity.LockInventory - Unable to acquire lock on CPU 2 for thread Thread[bg-3,5,main], trying to find another CPU [bg-3] WARN net.openhft.affinity.LockInventory - No reservable CPU for Thread[bg-3,5,main] [bg-4] WARN net.openhft.affinity.LockInventory - Unable to acquire lock on CPU 2 for thread Thread[bg-4,5,main], trying to find another CPU [bg-4] WARN net.openhft.affinity.LockInventory - No reservable CPU for Thread[bg-4,5,main] [bg-4] WARN net.openhft.affinity.LockInventory - No reservable CPU for Thread[bg-4,5,main] [bg-3] WARN net.openhft.affinity.LockInventory - No reservable CPU for Thread[bg-3,5,main]
My pool is trivial:
My task is trivial:
I'm using Gradle to build it:
Thanks in advance!