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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T20:19:10+00:00 2026-06-15T20:19:10+00:00

Use case : There is a lot of requests that should be processed. The

  • 0

Use case:

  1. There is a lot of requests that should be processed.
  2. The time taken to process each request varies.
  3. Request are meant to be processed concurrently (now they are pushed into the global queue got by dispatch_get_global_queue).
  4. Requests coming from the same client preferably should be processed synchronously, e.g., processing of rca1 from ca should be finished before start processing rca2, at the same time rcb1, rcd3, etc, are being processed.

    rca i : requests from client a.
  5. If processing a request is taking too long, i.e., more than TIME_OUT, other requests from the same client can start processing.

Using dispatch_get_global_queue and a serial queuevoid dispatch_after(
dispatch_time_t when,
dispatch_queue_t queue,
dispatch_block_t block)
for each client would be suboptimal when rca1 processing is finished but when has not arrived yet.

Having a serial queue per customer wouldn’t satisfy 5.


I’m aware that GCD is based on a different paradigm but is there any equivalent of pthread_mutex_timedlock or lockBeforeDate or Lock.tryLock in GCD?

How to implement the functionality provided by timed locks using GCD?

Grand Central Dispatch (GCD) Reference

  • 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-15T20:19:11+00:00Added an answer on June 15, 2026 at 8:19 pm

    You could have the next job block on a dispatch_semaphore with a timeout. You’d need to wait on job submission, though, not just job execution… otherwise GCD will spin up a ton of threads that immediately wait, which is not what you want.

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

Sidebar

Related Questions

I have the following use case: There's a class called Template and with that
Are there rules of thumb that help determine which to use in what case?
I have following use-case: there are several assemblies decorated with ProtoContract classes and I
My use case expects heavy read load - there are two possible model design
I have a use case with NServiceBus explained in this question. Essentially there is
Is there a pure-java way of setting the android:button attribute? My use case is
Is there a way to use one CASE statement and return 2 different values?
I'm developing web application that uses AJAX a lot. It sends several AJAX requests
I'm refactoring a project that involves passing around a lot of arrays. Currently, each
My usecase is a one-page site. On the page, there should be three frames.

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.