Thread: task systems

Results 1 to 3 of 3
  1. #1 task systems 
    Registered Member
    Join Date
    Oct 2013
    Posts
    775
    Thanks given
    48
    Thanks received
    104
    Rep Power
    14
    just wondering what the differences are in the two mainly used tasks system found in a pi

    the one graham released and the one stuart released or whomever.

    i know one implements runnable so it runs on its own thread and the other one gets processed with the server. a usual pi's game thread gets processed with by grahams task system. ive taken out that and have my main class implement runnable itself and things processed in run() so im pretty sure if i were to run game events with grahams task scheduler, it may cause concurrency problems later as its no longer synced with the main thread, but i was thinking about using it for other things like maybe background tasks that wouldnt exactly effect gameplay, im just tryna remove some overhead from the server.
    Reply With Quote  
     

  2. #2  
    Banned task systems Market Banned


    Join Date
    Jan 2011
    Age
    26
    Posts
    3,112
    Thanks given
    1,198
    Thanks received
    1,479
    Rep Power
    0
    Quote Originally Posted by Our Promise View Post
    just wondering what the differences are in the two mainly used tasks system found in a pi

    the one graham released and the one stuart released or whomever.
    - Graham's runs on it's own thread so in order for it to be safe it has to be used to "process" the server
    - Graham's is better designed
    - Graham's lacks an "attachment" feature so you have to check if the player has disconnected in every task (attachment feature takes a minute to add...)

    Quote Originally Posted by Our Promise View Post
    i know one implements runnable so it runs on its own thread and the other one gets processed with the server.
    correct

    Quote Originally Posted by Our Promise View Post
    a usual pi's game thread gets processed with by grahams task system. ive taken out that and have my main class implement runnable itself and things processed in run()
    this is fine, I think that cycle based tasks are best designed and make a lot more sense design-wise being processed by the engine rather than itself being the engine

    Quote Originally Posted by Our Promise View Post
    so im pretty sure if i were to run game events with grahams task scheduler, it may cause concurrency problems later as its no longer synced with the main thread
    correct

    Quote Originally Posted by Our Promise View Post
    but i was thinking about using it for other things like maybe background tasks
    you don't need Graham's TaskScheduler to do that (and I don't think he'd want you to use it for that) use a cached thread pool for small asynchronous operations and use a ScheduledExecutorService if those operations need to be scheduled to execute sometime in the future (can't think of an instance where you'd need that, just use a cached thread pool)

    Quote Originally Posted by Our Promise View Post
    im just tryna remove some overhead from the server.
    this isn't gonna remove much, if any overhead, but you have two choices

    - scrap Graham's TaskScheduler, use a raw ScheduledExecutorService (SES) to run your server and have it processing your CycleEvents
    - scrap CycleEvents, remove the threading and synchronization logic from Graham's system and use a SES to process it
    Reply With Quote  
     

  3. Thankful user:


  4. #3  
    Registered Member
    Karma_K's Avatar
    Join Date
    Nov 2012
    Posts
    4,283
    Thanks given
    152
    Thanks received
    610
    Rep Power
    108
    Quote Originally Posted by lare96 View Post
    - Graham's runs on it's own thread so in order for it to be safe it has to be used to "process" the server
    - Graham's is better designed
    - Graham's lacks an "attachment" feature so you have to check if the player has disconnected in every task (attachment feature takes a minute to add...)


    correct


    this is fine, I think that cycle based tasks are best designed and make a lot more sense design-wise being processed by the engine rather than itself being the engine


    correct


    you don't need Graham's TaskScheduler to do that (and I don't think he'd want you to use it for that) use a cached thread pool for small asynchronous operations and use a ScheduledExecutorService if those operations need to be scheduled to execute sometime in the future (can't think of an instance where you'd need that, just use a cached thread pool)


    this isn't gonna remove much, if any overhead, but you have two choices

    - scrap Graham's TaskScheduler, use a raw ScheduledExecutorService (SES) to run your server and have it processing your CycleEvents
    - scrap CycleEvents, remove the threading and synchronization logic from Graham's system and use a SES to process it
    Was hoping you'd reply, thanks
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Buying Daily Tasks & New person task system
    By JAVA GURU #1023 in forum Buying
    Replies: 2
    Last Post: 03-19-2012, 12:37 AM
  2. My Task System Interface [VIEWS/COMMENTS?]
    By Rage in forum Show-off
    Replies: 4
    Last Post: 01-22-2012, 07:34 AM
  3. Task System.
    By Sir Tom in forum Snippets
    Replies: 7
    Last Post: 12-25-2011, 11:22 PM
  4. Task System Interface
    By Archspire in forum Snippets
    Replies: 23
    Last Post: 11-10-2011, 12:21 AM
  5. Slayer Task System.
    By Bando in forum Snippets
    Replies: 5
    Last Post: 08-17-2010, 07:36 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •