El subproceso principal "Bloquear" (dispatch_get_main_queue ()) y (o no) ejecuta currentRunLoop periódicamente. ¿Cuál es la diferencia?

Tengo el siguiente código:

- (void)test_with_running_runLoop {
    dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);

    NSTimeInterval checkEveryInterval = 0.05;

    NSLog(@"Is main queue? : %d", dispatch_get_current_queue() == dispatch_get_main_queue());

    dispatch_async(dispatch_get_main_queue(), ^{
        sleep(1);
        NSLog(@"I will reach here, because currentRunLoop is run");
        dispatch_semaphore_signal(semaphore);
    });

    while (dispatch_semaphore_wait(semaphore, DISPATCH_TIME_NOW))
        [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:checkEveryInterval]];

    NSLog(@"I will see this, after dispatch_semaphore_signal is called");
}
- (void)test_without_running_runLoop {
    dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);

    NSLog(@"Is main queue? : %d", dispatch_get_current_queue() == dispatch_get_main_queue());

    dispatch_async(dispatch_get_main_queue(), ^{
        sleep(1);
        NSLog(@"I will not reach here, because currentRunLoop is not run");
        dispatch_semaphore_signal(semaphore);
    });

    NSLog(@"I will just hang here...");
    while (dispatch_semaphore_wait(semaphore, DISPATCH_TIME_NOW));

    NSLog(@"I will see this, after dispatch_semaphore_signal is called");
}

produciendo lo siguiente:

Starting CurrentTests/test_with_running_runLoop
2012-11-29 08:14:29.781 Tests[31139:1a603] Is main queue? : 1
2012-11-29 08:14:30.784 Tests[31139:1a603] I will reach here, because currentRunLoop is run
2012-11-29 08:14:30.791 Tests[31139:1a603] I will see this, after dispatch_semaphore_signal is called
OK (1.011s)

Starting CurrentTests/test_without_running_runLoop
2012-11-29 08:14:30.792 Tests[31139:1a603] Is main queue? : 1
2012-11-29 08:14:30.797 Tests[31139:1a603] I will just hang here...

Mis preguntas están relacionadas entre sí:

1) Si lo entiendo bien, la cola principal (dispatch_get_main_queue ()) es una cola serial. Bloqueo la cola principal / hilo principal con dispatch_semaphore_wait, ¿por qué veo la"Llegaré aquí, porque se ejecuta currentRunLoop" en el primer caso de prueba (estoy de acuerdo con el segundo caso, según tengo entendido, ¿qué debería hacer?)

2) como unde serie la cola, teniendo bloqueada la tarea de ejecución actual, puede tener una próxima tarea (oh, este misterioso runLoop: beforeDate :) enviado antes de que se desbloquee el actual?

quiero escuchardetallado yexhaustivo responda a esto, porque muchas, muchas cosas (aquí también en SO) dependen de este problema!

ACTUALIZAR: Además de la respuesta aceptada, este tema de SO tiene una buena respuesta a esta pregunta:Patrón para la prueba de unidad de cola asíncrona que llama a la cola principal al finalizar

Respuestas a la pregunta(1)

Su respuesta a la pregunta