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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T13:29:57+00:00 2026-06-01T13:29:57+00:00

I am looking for an equivalent pattern in multi-threading in iOS as there is

  • 0

I am looking for an equivalent pattern in multi-threading in iOS as there is in .NET for pulse and wait. Essentially, I want a background thread to lay dormant until a flag is set, which essentially “kicks” the thread into action.

It is an alternative to a loop+thread.sleep(). The flag can be set on a different thread than the actual background thread doing the processing. 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-01T13:29:59+00:00Added an answer on June 1, 2026 at 1:29 pm

    There are a variety of different mix-and-match thread APIs available on iOS and OS X. What are you using to create your thread?

    The simplest suggestion is to use a Grand Central Dispatch (GCD) semaphore.

    Setup code:

    dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);
    // Then make sure your thread has access to this semaphore
    

    Thread code:

    dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER);
    // Will block forever until the semaphore is triggered
    

    Trigger code:

    dispatch_semaphore_signal(semaphore);
    

    An even better suggestion: GCD already manages its own thread pool, so just take advantage of it instead of spinning up your own thread. It’s very easy to use dispatch_async to run some code in a background thread.

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

Sidebar

Related Questions

I'm looking for a pattern equivalent to \w, and which doesn't match numeric pattern.
I'm looking for the equivalent to the PHP function mysql_real_escape_string() to use in C#.NET.
I am from a Java background and I am looking from the equivalent in
I'm looking for an equivalent of Mechanize (Ruby/python and more) for iOS. I need
I'm looking for an equivalent of __asm__ int 3 for ARM/iOS processors for when
There is a shortcut in IntelliJ I'm looking equivalent in Eclipse, it is called
I'm looking for an equivalent of PerlCritic for PHP. PerlCritc is a static source
I'm looking for the equivalent of what in js would be 'this is a
I'm looking for the equivalent of [\w]&&[^\d] (Of course && is not a regex
Looking for a RAM disk API (or equivalent set of software to implement) to

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.