Multi Threading for MySQL?

Discussion in 'Plugin Development' started by connorlinfoot, Jun 1, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    connorlinfoot

    Hi,

    I'm working on a plugin of mine and I'm adding a feature known as clan (Similar to Guilds on Hypixel) but anyway, I was advised by someone who I know to use Multi Threading, I've never really heard of this and it would be great if someone could quickly explain this and maybe tell me if I should be using it or not.


    Thanks!
     
  2. Offline

    Arkel

    Bukkit provides you with the capability to execute tasks asynchronously, i.e. multi threading. This can be used to improve performance by offloading tasks such as I/O that would slow down the main server thread to other threads. You may think of a thread as another core on the processor, though this isn't exactly true.

    However, writing code that uses threads safely is quite difficult, and if not done properly, cause a lot of problems. Debugging multi threaded programs is notoriously difficult. Unless you are very confident in your abilities I wouldn't recommend the use of threading on a large scale within your plugin.

    Edit for MySQL: That said, since you are using MySQL which will likely slow down the main thread, you should really take the time to learn some more about threads and implement them in your plugin

    Bukkit Scheduler Programming
     
Thread Status:
Not open for further replies.

Share This Page