multithreaded server application

multithreaded server application


I'm a new user of TBB and I'm looking for some hints about the use of TBB in this context :

        -> Session(id:1) -> Task1(Type:1)
                         -> Task2(Type:2)
                         -> Task3(Type:3)
Network -> Session(id:2) -> Task4(Type:3)
                         -> Task5(Type:2)
                         -> Task6(Type:1)
        -> Session(id:3) -> Task7(Type:2)
                         -> Task8(Type:3)
                         -> Task9(Type:1)

  • It is a server application.
  • Each Session (client) produces Tasks (packet).
  • Tasks for a Session have to be always sequentially executed (Example : Task1 -> Task2 -> Task3)
  • Tasks of some Type have to be sequentially executed too (Example : Task1 -> Task6 -> Task9)
  • But not all Types (Example : Type3 don't need to be sequentially executed : Task4 -> Task8 -> Task3)
  • Sessions number could reach about 5000
  • Packets number shouldn't go over 10/second
  • Most of the tasks (in quantity) should be a non-sequential Type.

What features would you use to implements something like this ? (I'm just looking for the right feature choice, not a complete solution)

 PS : as a non-English-speaker, by sequentially I mean : tasks have to wait the end of execution of the previous one to be executed.


Thanks for reading

3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

I should add that I already have the system (async boost:asio server) which can fill the task queue. My question is more about the multithreaded handling / queueing of these tasks.


maybe "network router simulator" sample might help in your case


Leave a Comment

Please sign in to add a comment. Not a member? Join today