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

  • Home
  • SEARCH
  • 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 3614368
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T22:14:24+00:00 2026-05-18T22:14:24+00:00

I was contemplating the idea of using a single looping thread function to utilize

  • 0

I was contemplating the idea of using a single looping thread function to utilize multithreaded programming. However, it’s plain theory so I wonder what are your ideas since it’s probably wrong.

An example might be that a single function is called multiple times in scattered places around an application. While it would be hard to make parallel programming simply on it, one could have an extra thread that loops with a boolean that checks “do we need this function”, and if yes, then to execute it.

Is that even remote possible to have applications?

I suspect it will be slow due to some “lag” between the “call” for it via the boolean/var about it and the actual execution of the function in need.

EDIT: I had in mind a fast function, I suppose it might be doable if the function called is very slow (to complete).

Then again, we’d need to deal with thread safety and plain concurrency, so this is all probably wrong.

  • 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-18T22:14:25+00:00Added an answer on May 18, 2026 at 10:14 pm

    You could fire a thread to execute a function, but the caller would probably still want to wait for the result. Threading is by definition useful for processes that can be done in an isolated form. Not just any call is suitable to be threaded.

    If you define such a process, it will probably be just fine to execute multiple threads at once. I wouldn’t see any use of having one separate thread that is just calling functions from a queue.
    It could have some use in a reporting tool for example. To minimize database load, you could choose to execute only one or a small number of reports at a time. After a report is done, a thread could pick up a new report from a queue.

    To implement something like this, I would build (and actually have built) a connection pool and a tread pool. If you’d like to build something like this too, I’d encourage you to search for mutexes (atoms/critical sections) and semaphores.

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

Sidebar

Related Questions

I'm contemplating the idea of implementing a XML translator using a compiler generator, based
We're contemplating Visual Studio licensing and need to decide whether licenses for Architecture/Database/Test editions
I love Ruby blocks! The idea behind them is just very very neat and
I have a table with almost 800,000 records and I am currently using dynamic
Looking into developing new startup with potential of hopefully having high volume. Initial idea
I was contemplating switching to Linux for C++ development, coming from a Windows environment.
While contemplating this question about a SQL INSERT statement, it occurred to me that
I'm creating an application that I want to put into the cloud. This application
I've got a LOT of tests written for a piece of software (which is
I'm reviewing some legacy code and I've found a bug that causes the response

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.