Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 844307
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T06:15:54+00:00 2026-05-15T06:15:54+00:00

Now I’m in such a situation that there is a group of predefined tasks

  • 0

Now I’m in such a situation that there is a group of predefined tasks for multiple clients to do(any client can take any task). When a client connects to the server, server choose a task from the uncompleted tasks and send it to the client — job on the server side is quite easy. It takes a while for the client to finish the task and send the result back to the server.

Since a task should be sent to only one client, server should process requests in a serialized way. Now I have two plans to do it: create a thread for each client connection and all the threads take turns accessing the task pool, or use epoll listening on all the connection and process for each event of clients.

Which one is better for the job? Or is there any other ideas? The server will be run on a multi-core machine.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T06:15:55+00:00Added an answer on May 15, 2026 at 6:15 am

    The main question is whether the server has significant processing to do in order to prepare the tasks for the client. If not, there’s nothing to be gained from using multiple threads — on the contrary, the context switching will just add overhead. In this case it would be the best to use epoll (most likely via some existing library, depending on the programming language you’re using).

    If there is significant processing on the server side, it may offset the inefficiency of context switching, and improve performance by gaining parallelism from multiple core. The only way to know for sure what the best solution will be is to do some prototyping and profiling.

    Are the clients running on the same machine as the server is?
    If they are, you’ll be able to utilize the multiple cores easily.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Now I have a mp3 player that can play music, and I'm wondering should
Now that it's clear what a metaclass is , there is an associated concept
now i'm working on a project for creating audio unit instrument that provide the
Now I try to developing an application related to Image processing, for that I
Now I have a long query and I'd like to alternate with such a
I have a jquery bug and I've been looking for hours now, I can't
now that my orbit slider works almost perfect, i discovered a new problem. I'm
Now, that we have new iPhone 5 and iPad 3, what resolution of design
now i have such structure on my server ./site.com/ ./site.com/mage ./site.com/mage/Mage.php ./site.com/mage/app ......... ./site.com/public
Now that we soon have user defined literals (UDL), in GCC 4.7 for example,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.