scheduleAsyncDelayedTask not really Asnc

Discussion in 'Performance Tweaking' started by Crafter6432, May 9, 2013.

  1. Hi,
    I'm use the plugin PlayerMarkers for my Overviewer Map. During the plugin is enables my Server laggs(14-18TPS), so i disabled the Plugin and the laggs are still here but only a litte bit (19-20) TPS.
    I'm confused, why this plugin is cause lagg, because it's IO should be in a async task, but I doubted at that is realy async. So I had modifyed the code a litte bit:
    Code (Text):
    getServer().getScheduler().scheduleAsyncDelayedTask(this, mDataWriter);
    to
    Code (Text):
    new Thread(mDataWriter).start();
    and the Problem is solved. But i don't understand why, bukkit should do the same as Thread.start() or not?
     
  2. Hello,
    Try to use:
    PHP:
    Bukkit.getScheduler().runTaskAsynchronously(this, mDataWriter);
     
  3. md_5

    Administrator Developer

    It IS async..
     
  4. But why cause it laggs and Thread.start() not?