Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How can I use the THREAD of PocetMine?

Comments in 'Plugin Development' started by PopChicken, Apr 30, 2015.

  1. PopChicken
    Offline

    PopChicken New Member

    Joined:
    Apr 19, 2015
    Posts:
    6
    Minecraft User:
    None
    As the title, I need help... (In another word is how can I use pthread?) :) I want to know... Could you please help me? Thank for your help!
  2. Falk
    Offline

    Falk Staff Member Global Moderator

    Joined:
    Sep 2, 2013
    Posts:
    1,710
    Plugins:
    22
    Minecraft User:
    Falkirknh
    I have wanted to do this for a while and haven't been able to. I don't think it is possible. pthreads is very limited.
    HotFireyDeath likes this.
  3. PopChicken
    Offline

    PopChicken New Member

    Joined:
    Apr 19, 2015
    Posts:
    6
    Minecraft User:
    None
    One of my friends answered:"Before 1.4 you can uses more than one thread, but when 1.4 released, you can't just use one thread in fact!Very strange"
  4. Falk
    Offline

    Falk Staff Member Global Moderator

    Joined:
    Sep 2, 2013
    Posts:
    1,710
    Plugins:
    22
    Minecraft User:
    Falkirknh
    No, in 1.4 threading was greatly improved and AsyncTasks were added. Some changes were backwards incompatible though, now all threads most extend \pocketmine\Thread and not \Thread (same thing goes for workers). Also, with the 1.4 release, the pthreads version jumped significantly, this new version imposes greater thread safety than the pre-1.4 one. Check out Volt or PocketDockConsole for examples.
  5. PopChicken
    Offline

    PopChicken New Member

    Joined:
    Apr 19, 2015
    Posts:
    6
    Minecraft User:
    None
    thanks a lot! That mean I should extends pocketmine\Thread in the new version.:D
    PEMapModder likes this.

Share This Page

Advertisement