Multi-threading or just simply run task

Discussion in 'Plugin Development' started by iBo3oF, Mar 11, 2014.

Thread Status:
Not open for further replies.
  1. Hello,

    Which one would you advice multi-threading by my side or something like this:

    Code:java
    1. Bukkit.getScheduler().runTask(plugin, new BukkitRunnable() {
    2. @Override
    3. public void run() {
    4. //hardcore code
    5. }
    6. });


    I have already putted a lot of heavy things into the runTask, I don't think so it's good way to put more things.

    Question 2: If I would choose runTask or multithreading, should I get all variables before I put it to execute block and not using "final" modifier. Is final modifier healthy or not really?
     
  2. Wrong section :l
     
  3. Offline

    TnT

    Moved to the correct forum.

    DreamCastNetwork Reporting the thread will suffice. It helps eliminate duplicate threads as the OP won't feel required to go post in the appropriate forum when we're happy to move it for them.
     
    Garris0n likes this.
  4. Offline

    SuperOmegaCow

    iBo3oF
    Well keep this in mind, you can't make any api calls in a separate thread. Second, always use finals.. SPEEEED.
    Take a look at this: here
     
Thread Status:
Not open for further replies.

Share This Page