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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T04:06:05+00:00 2026-06-15T04:06:05+00:00

I’m using Visual Studio 2012 in Windows 7 64 bit. I need to use

  • 0

I’m using Visual Studio 2012 in Windows 7 64 bit.

I need to use concurrent data structures because I will be using threads. I found that microsoft has a few http://msdn.microsoft.com/en-us/library/dd504906.aspx#unordered_map

In general, I have to process

receive data into a queue…. process when ready … keep receiving data.

I’m going to use concurrent_unordered_map Class provided by microsoft to have a cuncurrent map that stores a class named TouchInfo.Each TouchInfo object has a unique ID (unsigned long) which is what I used to retrieve the object as it needs to be updated.

At the same time, I need to insert TouchInfo into a concurrent queue…
Once the queue hits a number I process the queue… (Different thread)

1.
My first question is if I need a special hash function of the unsigned long… The unsigned long is an ID (dwID) given by the system from the multi-touch system in Windows 7 (WinUser.h) Since I have no control of the ID, I want to make sure that my hash function is optimized.

typedef struct tagTOUCHINPUT {
    LONG x;
    LONG y;
    HANDLE hSource;
    DWORD dwID;
    DWORD dwFlags;
    DWORD dwMask;
    DWORD dwTime;
    ULONG_PTR dwExtraInfo;
    DWORD cxContact;
    DWORD cyContact;
   } TOUCHINPUT, *PTOUCHINPUT;

Maybe, I don’t have to do anything and just declare

I seen in the web that some people use Boost to create the Hash…

Any input and changes in my design, are completely welcome…

The Answer to my question is most welcome!

Thanks!

  • 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-15T04:06:07+00:00Added an answer on June 15, 2026 at 4:06 am

    concurrent_unordered_map uses std::hash, which has a default implementation for unsigned long. It’ll work fine right out of the box.

    The default hash tries to be optimal for most use cases, but there are no guarantees because everyone’s data is different. Definitely benchmark it before going crazy looking at hash functions (there are plenty, and you might waste lots of time).

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

Sidebar

Related Questions

I need a function that will clean a strings' special characters. I do NOT
I have thousands of HTML files to process using Groovy/Java and I need to
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am reading a book about Javascript and jQuery and using one of the
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I want use html5's new tag to play a wav file (currently only supported

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.