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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T22:27:00+00:00 2026-05-31T22:27:00+00:00

I have a multithreaded application. However I noticed, I’m using OpenGL and this should

  • 0

I have a multithreaded application. However I noticed, I’m using OpenGL and this should not work well without semaphores. And it did. I added semaphores later, because they should be used.

Not so great is the fact that I now have a multithreaded application which does not really seem to utilise multiple threads or cores on the cpu.

My load balance always seems to be towards a single cores (of 4) with a difference of atleast 40%.

Do I need to switch a trigger in Qt’s project file, or am I overlooking something else? It could be that this behaviour is expected, but clarification would be nice if so.

My platform is Ubuntu 11.10.

class DrawChunkThread : public QThread
{
    public:
        DrawChunkThread(World *world, int x, int z);
        void run();
        World *world;
        int x;
        int z;
        static QSemaphore *sem;
    private:
};


QSemaphore *DrawChunkThread::sem = new QSemaphore(1);

DrawChunkThread::DrawChunkThread(World *world, int x, int z) {
    this->world = world;
    this->x = x;
    this->z = z;
}

void DrawChunkThread::run()
{
    world->drawChunk(x, z);
    if (world->isInside) {
        world->drawInsideChunk(x, z);
    }
}
  • 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-31T22:27:01+00:00Added an answer on May 31, 2026 at 10:27 pm

    If the semaphores you added create a critical section that is either too long or too contended (or both), you will have scalability problems, because not all threads are allowed to execute the code at the same time and waiting on a semaphore triggers a context-switch, which adds further overheads.

    In general, your parallel application containing a serial portion cannot scale more than the parallel portion divided by the number of cores, as per Amdahl’s law.

    Without any concrete code, I cannot think of any other advice to give you.

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

Sidebar

Related Questions

I have this code will work in multithreaded application. I know that immutable object
I've got a multithreaded OpenGL application using PBOs for data transfers between cpu and
I have a multithreaded application that is using LinqToSql. One of the things I
I have a multithreaded WPF application that is using > 600 threads after is
I have a multithreaded application that runs using a custom thread pool class. The
I have a multithreaded application that has many concurrent operations going on at once.
In a multithreaded application. I have a bunch of function that loop through a
I have a multi-threaded Windows application that occasionally deadlocks. Inevitably this happens on a
I have a multithreaded Windows application where one of the threads has a message
I have a multi-threaded application that is using pthreads. I have a mutex() lock

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.