collinsmith / riiablo

Diablo II remade using Java and LibGDX
http://riiablo.com
Apache License 2.0
869 stars 99 forks source link

Improve Logger pool synchronization #116

Closed collinsmith closed 3 years ago

collinsmith commented 3 years ago

When writing thousands of log messages per second, LibGDX Pool#obtain() is returning null. I think this is due to a synchronization issue on the underlying collection (which is not synchronized). Temporary workaround has been to override #obtain() and loop until non-null reference is returned, and while this works there is technically the possibility of having #obtain() return the same reference for different log messages. Not a critical issue as this is only occurring so far in MPQ when outputting all table entries (16K). Suggested fix is to write a synchronized collection to support pooling.