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 5938553
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:42:09+00:00 2026-05-22T15:42:09+00:00

Context: I have a photo-uploading website set up. I need to perform operations on

  • 0

Context: I have a photo-uploading website set up. I need to perform operations on these uploads every time a user uploads a photo.

With help from other users here on SO, I came to the conclusion, that I needed a background thread that accepted these “processing jobs”, so I could return response to the user quickly, and let the background thread work on these background jobs.

I’m sort of “set” on a threading solution as opposed to a service for instance, as it’s not possible for me to set up a service on the webserver. I’ve read some things on message queues, and background threads, but I’m really in need of is some practical pointers as to how I should proceed.

Also – are there any things I should be aware of? Off the top of my head, I’m thinking about the number of threads, and possibly hitting a snag with the IIS or server if too many threads are running? That’s why I’m thinking it should be a single background thread per user, and not a thread per job, as there could be MANY photos uploaded at once. So a single thread per user that takes care of the jobs in a ‘queue’ like fashion. Am I way off base?

  • 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-22T15:42:10+00:00Added an answer on May 22, 2026 at 3:42 pm

    You can run as many threads as you like, but you’ll run the risk of spending more time on context switching that actual crunching. If you need good CPU performance you should use no more than 1 thread per CPU core. The PLINQ stuff has this exact strategy. If you tell PLINQ to run a query it will execute in parallel the equivalent of the number of CPU cores available on your system.

    If you’re gonna implement queue, you should be thinking of a FIFO queue, users put their work in a bunch of threads or servers pull work from this queue and does the work.

    i.e. you can use a SQL Server database to synchronize work cross many machines using a FIFO queue in the database (this is just a simple table that you pull work from). It will scale pretty well and it’s also more robust because work can be resumed if it crashes or timeouts.

    You should read this question i posted about this a while back. Remus Rusanu posted some intresting links on the topic that discusses the use of a database to orchestrate work loads.

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

Sidebar

Related Questions

Context We have a SharePoint site set up on a Windows Server 2008 VM
I have an upload form that will allow a user to upload a photo,
Context: I have a class that implements a Session, maintaining a TCP connection to
Context I have a list of items I also have a structure with s
I have a context loader class which loads an XML file with info on
I have a LINQ TO SQL Context that I have created that calls a
Context I'm trying to have some "plugins" (I'm not sure this is the correct
I have a bitmap image context and want to let this appear blurry. So
I have a prototype question in the context of Ruby on Rails. QUESTION -
I have a core data context with objects that have a date stored in

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.