Siguza / VirtualPack

Bukkit Plugin "VirtualPack"
http://dev.bukkit.org/bukkit-plugins/virtualpack/
7 stars 10 forks source link

New, non-pooled thread on player login #22

Closed vemacs closed 9 years ago

vemacs commented 10 years ago

You should be using the Bukkit Scheduler, which has a CachedThreadPool. Instanciating new non-pooled threads can result in a fairly big performance hit. Just runTaskAsync on a BukkitRunnable.

Siguza commented 9 years ago

I assume I should do the same with all Threads I create?

vemacs commented 9 years ago

Yep. You could create your own thread pool, but there's really no point in doing that when Bukkit already provides one.

Siguza commented 9 years ago

Should (finally) be fixed in dev build 129. I replaced almost all Threads with equivalent BukkitRunnables except for those on which I need actual Thread methods as Bukkit doesn't seem to provide a .join() functionality.