Questions tagged [cfrunloop]
49 questions
2
votes
6 answers
iPhone crash, ASIHTTPRequest or NSURL related
Given the following symbolicated crash log, is it more likely that the crash occurred due to the ASIHTTPRequest on Thread 5 or the NSURLConnection on Thread 3? I ask because this question has similar issues: ASIHTTPRequest, EXC_BAD_ACCESS when…

joshholat
- 3,371
- 9
- 39
- 48
2
votes
1 answer
How to make AudioQueue play without freezing GUI?
I just began learning about AudioQueues from the CoreAudio book (rough cuts).
I did the AudioQueue playback example tutorial, which is basically the same as the apple tutorial example. Everything is working fine.
The problems start when I try to…

Kasper Welner
- 545
- 3
- 11
2
votes
0 answers
Diagnosing run loop issue (partially frozen UI) in Cocoa application
Our application has a fairly standard layout - a main window with a toolbar, source list on the left hand side, and a tab control. The contents of the tabs is drawn by a third party component that is open source and very complex. It makes extensive…

TheNextman
- 12,428
- 2
- 36
- 75
2
votes
0 answers
How to use Core Foundation Message Ports to communicate between run loop sources
I have the following code where I attempt to create a message port for communication between two run loops. 1 run loop is executing instead of a pthread and the other is the main run loop. This function appears to function normally under a number…

Alex Barker
- 4,316
- 4
- 28
- 47
2
votes
2 answers
iOS: CFRunLoopRun() function confusion
I've read about CFRunLoop but still a bit confused about it. I came a cross a piece of code that I'd like to clarify for myself:
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init];
[request setURL:[NSURL URLWithString:[NSString…

ymotov
- 1,449
- 3
- 17
- 28
1
vote
0 answers
Is that possible I can use the CFRunloop mechanism within a threadFunction created by pthread?
For some reason, I cannot use NSThread. But I thing the communication way using the CFRunloopSource between 2 threads is convient. So I wonder that if I can obtain the current cfrunloop ref within the thread context created by pthread?
I grabbed…

Jack Seraph Mu
- 61
- 5
1
vote
3 answers
why CFRunLoopRun does not work?
[self request]; //main thread
- (void)request {
[self performSelectorInBackground:@selector(regFun) withObject:nil];
}
- (void)regFun {
CFRunLoopRun();
CCLOG(@"CFRunLoopRun not work");
}
Given the previous code, do you know why…

wupei
- 21
- 3
1
vote
1 answer
Modal alert in background thread in iPhone
In my iPhone app, main thread creates a background thread which does a lot of work and in some cases needs to ask user for their decision. When user is asked the question, background thread should stop working and should continue only after user has…

Nadya
- 73
- 2
- 10
1
vote
1 answer
In Macos, how to Move pasteboard `promiseKeeper` Function to a Specific Child Thread to Avoid Main Thread Blocking?
Questions:
I am currently using the QT 15.15.2
I am currently using the library. Based on my understanding:
I can use PasteboardSetPromiseKeeper to set a promise keeper function for clipboard handling…

gao.xiangyang
- 81
- 9
1
vote
2 answers
How to exit from `RunLoop`
I'm subclassing InputStream from iOS Foundation SDK for my needs. I need to implement functionality that worker thread can sleep until data appear in the stream. The test I'm using to cover the functionality is below:
func…

Ihar Katkavets
- 1,510
- 14
- 25
1
vote
2 answers
NSTimer setFireDate
Is considered thread-safe to call setFireDate: from another thread than the one in which the timer is scheduled? I mean, I detach this function in a new thread:
-(void)CFRunLoopTest {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
…

Manlio
- 10,768
- 9
- 50
- 79
1
vote
0 answers
Why does CFRunLoopActivity behave differently in iOS and MacOS?
I use the same code in the iOS and macOSX two platforms to test, view the Runloop's activity switch, found that the results of the two platforms are not the same, what is the reason.s
Code:
1.create RunLoop Observer
CFRunLoopObserverContext context…

Stephen Lee
- 23
- 3
1
vote
1 answer
App crashes for iOS 11.2 CFRunLoopServiceMachPort
I have a few CFRunLoopServiceMachPort crashes for my app. I've been trying to figure out the root cause for this.
There is some task that I am doing in background thread to avoid congestion on Main thread. I guess this might have some part in…

Sajjad Haider Zaidi
- 163
- 11
1
vote
1 answer
How does NSUndoManager.groupsByEvent determine the current run loop pass?
I'd like to understand/replicate the "group by run loop pass/cycle" feature of NSUndoManger:
NSUndoManager can group multiple calls to registerUndo() into a single "undo" operation when invoked multiple times on the same run loop cycle. This is…

Mark
- 6,647
- 1
- 45
- 88
1
vote
0 answers
What does "poll" in cocoa runloop means?
In Apple's implement for CFRunloop,in function __CFRunLoopRun they define a local var named pool:
Boolean poll = sourceHandledThisLoop || (0ULL == timeout_context->termTSR);
And then they used this value like this:
if (!poll && (rlm->_observerMask…

Karl
- 665
- 4
- 19