Questions tagged [libdispatch]

The libdispatch project consists of the user space implementation of the Grand Central Dispatch API.

50 questions
1
vote
1 answer

What is the point of the offset variable in dispatch_data_apply for libdispatch?

I'm having trouble understanding the offset variable provided to the data applier for a dispatch_io_read function call. I see that the documentation claims the offset is the logical offset from the base of the data object. Looking at the source code…
TReed0803
  • 585
  • 3
  • 9
1
vote
1 answer

Why is NSOperationQueue.mainQueue.maxConcurrentOperationCount set to 1

The reason for this question is because of the reactions to this question. I realized the understanding of the problem was not fully there as well as the reason for the question in the first place. So I am trying to boil down the reason for the…
drkibitz
  • 507
  • 5
  • 15
1
vote
1 answer

What causes libdispatch error EVFILT_MACHPORT in MacOSX Sierra?

Good morning, I am facing a crash in my application. When the user tries to start it, he waits like a minute and then a std::exception is raised. Really I could not reproduce the bug by myself, but it seems quite a common problem. The only thing I…
n3mo
  • 663
  • 8
  • 23
1
vote
0 answers

What is the scheduling model for libdispatch (GCD)?

What is the scheduling model for blocks in libdispatch? I understand there are various queues with different priorities. Is it as simple as the highest priority queue gets served first by worker threads? If this is the case how does it avoid…
jack sexton
  • 1,227
  • 1
  • 9
  • 28
1
vote
0 answers

libDispatch serving RunOnMainQueueDelayed from Java

I am using libDispatch (GCD) opensource on Android platform. So, most of the complex time consuming tasks are being done through NDK (where i am using libDispatch). I am scheduling some tasks with delay on the MainQueue using the function…
Pankaj Goyal
  • 103
  • 1
  • 11
1
vote
1 answer

Interoperability of NSOperationQueue and GCD

I am building a library for which I'd like the processing to happen in a single serial queue. Some of the APIs I use take NSOperationQueue (e.g. NSURLSession) and some take dispatch_queue_t (e.g. CBCentralManager). How do I specify the…
user1002430
1
vote
1 answer

What is a flexible method to convert a C style API to use libdispatch with blocks

I have an existing C API written in C that makes heavy use of status codes returned from functions for error handling. I'm trying to understand the preferred method of handling this type of situation with libdispatch. Here's an example function. The…
Lucas Holt
  • 3,826
  • 1
  • 32
  • 41
1
vote
1 answer

Is this crash in libdispatch caused by Reachability?

Can anyone tell me if this crashing stack appears to be caused by Reachability? I am running apple's latest implementation of Reachability, downloadable at https://developer.apple.com/library/ios/samplecode/reachability/Introduction/Intro.html I…
esilver
  • 27,713
  • 23
  • 122
  • 168
1
vote
1 answer

SIGILL after fork in Sage/Python

I'm doing some calculations with Sage. I am playing around with fork. I have a very simple test case which is basically like this: def fork_test(): import os pid = os.fork() if pid != 0: print "parent, child: %i" % pid …
Albert
  • 65,406
  • 61
  • 242
  • 386
0
votes
0 answers

OpenCL on MacOS: SIGABRT in release build, EXC_BAD_INSTRUCTION in libdispatch in debug build when using AMD Radeon 555 as CL device

I'm encountering a hard to track down bug on MacOS in an OpenCL-based application. In a release build my code crashes with a SIGABRT at some point, in a release build I get an EXC_BAD_INSTRUCTION on a thread obviously managing some lib dispatch /…
PluginPenguin
  • 1,576
  • 11
  • 25
0
votes
0 answers

Can i build libdispatch on my xcode?

I want to know how GCD work on iOS.Then I download libdispatch-913.30.4 from opensource.apple.com, but i don't know how to build and debug it on my Xocde, it has much error. the install.md says i can build it with above code: sh…
GodCard
  • 31
  • 3
0
votes
0 answers

libdispatch-dev SIGILL, Illegal Instruction in dispatch_release

I have a program that utilizes libdispatch in Ubuntu linux. At the end of my main function, I have the dispatch_main() to keep the main thread hanging. The rest of my program runs as expected but for some reason once dispatch_main is called at the…
Jia Li
  • 5
  • 5
0
votes
1 answer

10.9.5 production crash with libdispatch - how to debug?

I just released an OSX app to the App Store, and reports are coming in that it crashes on OSX 10.9.5 Here is the relevant information from a user crash report: Crashed Thread: 0 Dispatch queue: com.apple.main-thread Exception Type: …
spinalwrap
  • 683
  • 1
  • 4
  • 17
0
votes
1 answer

Where is libdispatch AKA Grand Central Dispatch imported?

I am reading Apple's documentation on Concurrency, more specifically on NSOperationQueue vs a Dispatch Queue. They say this: "An operation queue is the Cocoa equivalent of a concurrent dispatch queue ..." Which made me wonder, if…
A O
  • 5,516
  • 3
  • 33
  • 68
0
votes
1 answer

Cancelling dispatch_io_read

I'm parsing a very large CSV file using GCD functions (please see code below). If I encounter an error I'd like to cancel dispatch_io_read. Is there a way to do that? dispatch_io_read(channel, 0, Int.max, …
Albin Stigo
  • 2,082
  • 2
  • 17
  • 14