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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T04:25:13+00:00 2026-06-11T04:25:13+00:00

I am doing multi-thread programs with QT. I use this code to try whether

  • 0

I am doing multi-thread programs with QT.

I use this code to try whether it acts as i expected.

QFuture<void> t1 = QtConcurrent::run(thread_process1, (void *)this);
QFuture<void> t2 = QtConcurrent::run(thread_process2, (void *)this);

and both thread_process1 and 2 are only one line which is

qDebug()<<"thread id: "<<QString("%1").arg((int) QThread::currentThreadId(), 0, 16) ;

however, they both show
thread id: “ffffffffb6085b40”

am I do it wrong??
QFutureWatcher seems to do no help.

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

    The docs for run say,

    Runs function in a separate thread. The thread is taken from the
    global QThreadPool. Note that the function may not run immediately;
    the function will only be run when a thread is available.

    There is no guarantee that each call to run will run in a different thread. It is possible that the functions run so quickly they are both handled sequentially by the same thread. Try putting in a sleep call in thread_process_1 to see if the functions are then picked up by different threads.

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

Sidebar

Related Questions

I was just doing some random testing on locking in multi-threading this morning and
Doing an ajax get request works as expected using the following code: $.ajax({ type:
I downloaded the code DigitalDJ / AudioStreamer to use in a player I'm doing,
I have writing a multi threaded code. I am not sure, whether I would
I have just learned that you can use a Thread pool for multi client
I am doing dual core optimization by multi-threading, and it works like this: If
I've been doing simple multi-threading in VB.NET for a while, and have just gotten
I'm doing a multi texture operation that blends a certain amount of grey into
I am doing some multi-touch support that allow 2 fingers to rotate a photos.
I'm doing some development work on a Magento site network (multi-store install). What I'm

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.