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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T02:35:55+00:00 2026-05-18T02:35:55+00:00

I have a boost based thread(let’s call it T-thread) separate from the iphone’s main

  • 0

I have a boost based thread(let’s call it T-thread) separate from the iphone’s main thread.
This custom T-thread talks to yet other threads using custom message objects.

The thing is iphone’s main thread(UI thread) and this T-thread don’t need to be threaded to each other. And having separate threads makes my life miserable having to think over thread safety.

I’d like to combine the main thread and T-thread but can’t figure out the basic strategy or not sure if this can be done.

My custom thread class (using boost::thread) has 4 methods.

  1. the thread loop

  2. PushMessage (takes a custom class message and pushes onto queue)

  3. PopMessage (pops a message from the queue)

  4. Dispatch (Actual work)

In some way, I need to incorporate the above 4 methods into the main thread.
Any suggestion will be appreciated. Thank you.

  • 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-18T02:35:55+00:00Added an answer on May 18, 2026 at 2:35 am

    umm, maybe easier than i worried.

    PerformSelectorOnMainThread can emulate push/pop.
    Just need to make a static object to execute the ‘selector’ so that main loop can access the object all the time.

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

Sidebar

Related Questions

I have a program that uses the mt19937 random number generator from boost::random. I
I have to use a smart pointer and I found shared_ptr from boost looks
Since I have started using this site, I keep hearing about the Boost library.
I have a question about boost::shared_ptr<T> . There are lots of thread. using namespace
At work we have a base class, let's call it IntrusiveBase, that acts something
I have a UDP based application that is implemented using a thread pool. Messages
I have a boost::asio based server which works fine, except that I'm trying to
I have a Boost unit test case which causes the object under test to
I have just installed boost for the first time on my Intel Mac, and
I have just started using Boost 1.36. These libraries would be very useful in

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.