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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T00:14:12+00:00 2026-06-09T00:14:12+00:00

I have a question regarding CreateMutex() I am working on image data, and do

  • 0

I have a question regarding CreateMutex()

I am working on image data, and do certain calculations for different rotations of the image. I rotate the image in 180 steps (1° steps), and since these are independent from each other except writing the results back, I have decided to make this multi-threaded (very intensive calculations, and writing to memory takes up like no time of the execution).

I tried at first using a single mutex which allows a thread to write or not to write, but that decreased my performance a lot (got from 100% time with single thread, no mutex, to around 80% execution speed).

I have then created an array of HANDLE s, one per pixel (since its 656×480, its around 300k handles). This has improved my code to around 15% execution time (7 threads simultaneously).

Now when I watch this in the task manager, I see it has its own category called Handles, and this goes between 30k (with only some programs and OS running), and goes to 350k with my code running.

Is this behaviour okay, or is it bad and should be changed, if so, why, and how?

  • 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-06-09T00:14:13+00:00Added an answer on June 9, 2026 at 12:14 am

    I would say that a single process using 350k+ handles is far too many. (One handle per pixel, really?)

    If you’re looking to improve the overall efficiency of your application using multiple threads, a good thing to do is reduce the amount of contention between those threads. I’m not quite sure what your application is doing, but if you are creating 180 different rotations of a single source image, then you might consider making N copies of the source image (where N is the number of threads you want to run), and having each thread work on its own copy of the source image. Then you won’t need to have mutexes at all, and you will reduce the contention between threads.

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

Sidebar

Related Questions

I have a question regarding OpenGL glBufferData() method.Can I pass the vertex data in
I have a question regarding calling methods from different threads. Well I am using
I have a question regarding parsing data from Wikipedia for my Android app. I
I have a question regarding the steps I should follow to use an old
I have question regarding the storage of large amount of data. The situation is
I have a question regarding clearing of the log data in Magento. I have
I have a question regarding Highstock. I am having a data recording Engine Load
I have question regarding the SQLAlchemy. How can I add into my mapped class
I have question regarding the use of function parameters. In the past I have
I have question regarding disabling browser caching. I have already found few solutions, and

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.