The libdispatch project consists of the user space implementation of the Grand Central Dispatch API.
Questions tagged [libdispatch]
50 questions
2
votes
1 answer
How to use `IOConnectCallAsyncScalarMethod` with a GCD dispatch queue
I am working on some code that uses IOConnectCallAsyncScalarMethod() to get callbacks from a DriverKit extension. The setup is quite heavy, involving spawning a thread, manually creating a CFMachPortRef, adding its CFRunLoopSourceRef to a CFRunLoop…

Jonas Due Vesterheden
- 459
- 4
- 22
2
votes
1 answer
DispatchSourceTimer on concurrent queue
By default when creating a DispatchSourceTimer, the default concurrent queue is used for dispatching timer events and cancellation.
What's interesting that one shot timers still dispatch the call to cancellation handler even after the event handler…

pronebird
- 12,068
- 5
- 54
- 82
2
votes
1 answer
what's meaning of this code from the libdispatch (apple-open-source)?
I am having hard time understanding the following code:
struct dispatch_block_private_data_s {
DISPATCH_BLOCK_PRIVATE_DATA_HEADER();
static void* operator new(size_t) = delete;
static void* operator new [] (size_t) = delete;
…

zox01
- 66
- 6
2
votes
1 answer
How many threads should Grand Central Dispatch be creating?
I understand that GCD will only create as many threads as needed to make best use of the CPU. In code using dispatch_async to launch about 30 background tasks, I'm seeing the number of threads jump by about 30 in Activity Monitor. I would not have…

Nick Moore
- 15,547
- 6
- 61
- 83
2
votes
1 answer
Compiling libDispatch (GCD) for Android
I'm trying to compile libdispatch for linux on Android. However I could not find any instructions for Android in the project files.
I can see there are several StackOverflow questions about using libdispatch, but the information is rather thin.…

Sam Khawase
- 348
- 6
- 21
2
votes
1 answer
what is the voucher mean in libdispatch from apple?
I just read source code of libdispatch, but i found there is a word, "voucher", just appear so many times, but i do not know what it is mean actually.
So could any tell me the true means of this word, thank you very much for your great help.
Best…

Axis
- 71
- 3
2
votes
2 answers
fastest way to blit image buffer into an xy offset of another buffer in C++ on amd64 architecture
I have image buffers of an arbitrary size that I copy into equal-sized or larger buffers at an x,y offset. The colorspace is BGRA. My current copy method is:
void render(guint8* src, guint8* dest, uint src_width, uint src_height, uint dest_x, uint…

mpr
- 3,250
- 26
- 44
2
votes
1 answer
How to use GLFW to poll for events in a libdispatch block?
Following up on the answer to How to use GLUT with libdispatch?, I'm now using GLFW instead —
The following code sets up a window, sets up a timer to poll for events, and, over time, enqueues render updates:
#include
#include…

smokris
- 11,740
- 2
- 39
- 59
2
votes
1 answer
How to use GLUT with libdispatch?
Both GLUT and libdispatch have their own event-handling loops, which are invoked with functions that never return: glutMainLoop(); and dispatch_main();, respectively.
I've tried:
dispatch_queue_t q =…

smokris
- 11,740
- 2
- 39
- 59
1
vote
0 answers
Task with high quality-of-service submitted to low QoS queue
I'm learning Swift concurrency and encountered this excerpt
“If you submit a task with a higher quality of service than the queue has, the queue’s level will increase. Not only that, but all the operations enqueued will also have their priority…

chlkdst
- 175
- 3
- 13
1
vote
0 answers
Swift 5 very random and hardly identifiable crashes
My crash log from firebase unfortunately doesnt really help me finding a solution to my issue.
Crashed: com.apple.main-thread
0 MyApp 0x94d30 PostsAPI.loadNewestPosts(ordering:start:limit:onSuccess:) + 4306505008…

Zash__
- 293
- 4
- 16
1
vote
0 answers
App Crashing with libdispatch.dylib _dispatch_lane_resume
I got the logs from Firebase Crashlytics, my app is crashing but doesn't know where it is crashing. As crash logs are also not mentioning any specific line where the app is crashing. Please suggest if anybody else face such type of problem…

Harsh Sharma
- 71
- 6
1
vote
1 answer
Python is crashing due to libdispatch crashing child thread
I am using the pynetdicom library to receive and process medical dicom images. The processing is performed in the callback function "on_association_released". However, when receiving certain studies, it will cause Python to crash due to what appears…

Haris
- 77
- 10
1
vote
1 answer
How to run swift and libDispatch on ARM (Raspberry Pi)
The aim is to run swift and libDispatch on a Raspberry Pi 3. I’m using Ubuntu Core 16.04
Where I’m at: I’ve tried to get SR-397 (https://bugs.swift.org/browse/SR-397) to compile - it is a minimal Swift libDispatch example.
The projects for this SR…

steve77
- 243
- 2
- 9
1
vote
1 answer
NSScrollView in NSPrintOperation accessory view doesn't scroll properly
I have to do a bit of processing before my app can start printing, so I do that on a thread, and once it is all done, I do
dispatch_async(dispatch_get_main_queue(),^(){
ULIPrintableView *viewForPrinting = [[ULIPrintableView alloc]…

uliwitness
- 8,532
- 36
- 58