Modern Industrialization

Modern Industrialization

12M Downloads

Use thread-safe queue for tooltips

Swedz opened this issue ยท 2 comments

commented

I only have proof it has happened with my similar tooltip system, but MI uses a PriorityQueue to store the tooltips for items (see here) and EMI will try to load tooltips asynchronously over multiple threads which can cause a ConcurrentModificationException in MITooltips.attachTooltip (here). Here is the issue i opened on my mod doing a similar thing if you want to see the stacktrace. Not sure if this is just a me thing, since I've only ever seen this happen once and it was with my mod but thought I should give you a heads up.

commented

I wonder how applicable this is to how MI currently operates. If all the tooltip attachments get registered in the same class, the registration is protected by the class initialization lock.

commented

Currently not applicable to MI so I'll be lazy and wait until the issue shows up if ever. :P