Thread: Threading/Concurrency designs

Page 1 of 7 123 ... LastLast
Results 1 to 10 of 70
  1. #1 Threading/Concurrency designs 
    Banned

    Join Date
    Dec 2008
    Posts
    2,097
    Thanks given
    1,419
    Thanks received
    732
    Rep Power
    0
    I'd like to get a good discussion going with some of the educated members here about how a server should be threaded.

    I personally am still brainstorming and trying to come up with a good design but I'd like to see what others think so discuss.
    Reply With Quote  
     

  2. #2  
    Extreme Donator


    Join Date
    Jul 2009
    Age
    27
    Posts
    4,351
    Thanks given
    826
    Thanks received
    1,239
    Rep Power
    1781
    Define "How" it should be threaded, What exactly are you asking?

    You can find my GitHub here, for what I'm currently working on.
    Reply With Quote  
     

  3. #3  
    Banned

    Join Date
    Dec 2008
    Posts
    2,097
    Thanks given
    1,419
    Thanks received
    732
    Rep Power
    0
    Quote Originally Posted by 'Tom View Post
    Define "How" it should be threaded, What exactly are you asking?
    Sorry if I didn't explain it well.. but I mean like using single threads/thread pools for different things such as game logic, IO task, etc..

    Oh and taking advantage of multiple cores
    Reply With Quote  
     

  4. #4  
    Registered Member
    Mister Maggot's Avatar
    Join Date
    Dec 2008
    Posts
    7,227
    Thanks given
    3,283
    Thanks received
    2,875
    Rep Power
    5000
    Quote Originally Posted by Jimmy View Post
    Sorry if I didn't explain it well.. but I mean like using single threads/thread pools for different things such as game logic, IO task, etc..

    Oh and taking advantage of multiple cores
    Use pools for executing player updates.
    Reply With Quote  
     

  5. Thankful users:


  6. #5  
    Banned

    Join Date
    Dec 2008
    Posts
    2,097
    Thanks given
    1,419
    Thanks received
    732
    Rep Power
    0
    Quote Originally Posted by Mister Maggot View Post
    Use pools for executing player updates.
    A little more specific? How would you take advantage of the amount of cores and pool size...
    Reply With Quote  
     

  7. #6  
    Registered Member
    Mister Maggot's Avatar
    Join Date
    Dec 2008
    Posts
    7,227
    Thanks given
    3,283
    Thanks received
    2,875
    Rep Power
    5000
    Quote Originally Posted by Jimmy View Post
    A little more specific? How would you take advantage of the amount of cores and pool size...
    Create a pool with the same number of threads as the number of cores to theoretically reduce your load to 100/cores of what it was. Player updating is the vast majority of what eats up each cycle.
    Reply With Quote  
     

  8. Thankful user:


  9. #7  
    Banned

    Join Date
    Dec 2008
    Posts
    2,097
    Thanks given
    1,419
    Thanks received
    732
    Rep Power
    0
    Quote Originally Posted by Mister Maggot View Post
    Create a pool with the same number of threads as the number of cores to theoretically reduce your load to 100/cores of what it was. Player updating is the vast majority of what eats up each cycle.
    Would there be any advantages of using a cached thread pool for updating players/npcs.
    Reply With Quote  
     

  10. #8  
    Community Veteran


    Join Date
    Jan 2008
    Posts
    2,659
    Thanks given
    494
    Thanks received
    627
    Rep Power
    980
    Quote Originally Posted by Jimmy View Post
    Would there be any advantages of using a cached thread pool for updating players/npcs.
    Not really. You're only using multiple threads for more processing power.
    ~iKilem
    Reply With Quote  
     

  11. #9  
    Respected Member


    Join Date
    Jan 2009
    Posts
    5,743
    Thanks given
    1,162
    Thanks received
    3,603
    Rep Power
    5000
    Its better to have a fixed pool for something like player updating as too many threads will cause more damage to the server then good as player update would create a new thread for every update... I know it might seem good using multiple threads but there is allot of work behind the scenes you would need to create a new runnable event for each player the thread pool then has to put that into account and run it when a thread is free to do so.

    Im not sure about the order of completion in regards to the player updating but if lets say the players appearance did change during the player update procedure im pretty sure what ever collection is holding your player object would also need to be thread safe which would kill any performance gain you got from using a thread pool. Maybe a worker thread would be more practical for that sort of thing...
    Reply With Quote  
     

  12. #10  
    Registered Member
    Mister Maggot's Avatar
    Join Date
    Dec 2008
    Posts
    7,227
    Thanks given
    3,283
    Thanks received
    2,875
    Rep Power
    5000
    Quote Originally Posted by thispixel View Post
    Its better to have a fixed pool for something like player updating as too many threads will cause more damage to the server then good as player update would create a new thread for every update... I know it might seem good using multiple threads but there is allot of work behind the scenes you would need to create a new runnable event for each player the thread pool then has to put that into account and run it when a thread is free to do so.
    Code:
    class Mob extends Entity implements Runnable
    
    for(int i = 0; i < allMobs.length; ++i)
        engine.submit(allMobs[i]);
    Reply With Quote  
     

Page 1 of 7 123 ... LastLast

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. Replies: 32
    Last Post: 06-13-2011, 07:58 PM
  2. I fucking love concurrency
    By gnarly in forum Application Development
    Replies: 7
    Last Post: 02-16-2010, 05:22 PM
  3. Advanced Concurrency
    By blakeman8192 in forum Application Development
    Replies: 12
    Last Post: 01-31-2010, 07:05 AM
  4. What is concurrency?
    By Vastiko in forum Application Development
    Replies: 22
    Last Post: 06-03-2009, 02:45 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •