You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Async.background reports/uses queues other than background #22
I made a new Swift project (single view controller) and added Async.swift file. I used the following sample code in my viewDidLoad:
Async.background {
println("A: This is run on the \(qos_class_self().description) (expected \(QOS_CLASS_BACKGROUND.description))")
}.main {
println("B: This is run on the \(qos_class_self().description) (expected \(qos_class_main().description)), after the previous block")
}
Running the project multiple times, the results I get are either:
A: This is run on the User Initiated (expected Background)
B: This is run on the Main (expected Main), after the previous block
Or:
A: This is run on the Main (expected Background)
B: This is run on the Main (expected Main), after the previous block
Never do I get the first block reporting that it is running on the background queue.
From my own findings: I would like to believe that the simulator is not capable of running multithreaded code, but the problem I have with that, is that if normal GCD works in the simulator and Async doesn't. This sounds like a fixable problem to me. @duemunk: Maybe you should add this discovery to the README to save people some time until the bug is fixed. Just my $0.02
@istx25 If you can make GCD work in these cases where Async doesn't, please let me know. I think GCD works fine with the pre iOS 8 queue classes, but not with the new ones e.g. DISPATCH_QUEUE_PRIORITY_BACKGROUND. @damonjones I don't know if it's in the Readme, but it has been a Github issue before #13. I'll update the ready :)
Added to readme as of bf2983e. @istx25 If you find anything, please just comment on this issue even though it's closed. Or even better. Make a gist and add a reference to it in the readme under Known Bugs :)
Activity
damonjones commentedon Feb 11, 2015
I also opened the AsyncExample project and ran the iOS tests:

duemunk commentedon Feb 11, 2015
Did you run in simulator?
damonjones commentedon Feb 11, 2015
Yes.
damonjones commentedon Feb 11, 2015
I just ran it on a device and the tests passed. Did I miss somewhere where it said that this doesn't work with the simulator?
istx25 commentedon Feb 11, 2015
Possibly relevant: http://stackoverflow.com/a/5172968/3409110
istx25 commentedon Feb 11, 2015
From my own findings: I would like to believe that the simulator is not capable of running multithreaded code, but the problem I have with that, is that if normal GCD works in the simulator and Async doesn't. This sounds like a fixable problem to me. @duemunk: Maybe you should add this discovery to the README to save people some time until the bug is fixed. Just my $0.02
duemunk commentedon Feb 11, 2015
@istx25 If you can make GCD work in these cases where Async doesn't, please let me know. I think GCD works fine with the pre iOS 8 queue classes, but not with the new ones e.g.
DISPATCH_QUEUE_PRIORITY_BACKGROUND.@damonjones I don't know if it's in the Readme, but it has been a Github issue before #13. I'll update the ready :)
duemunk commentedon Feb 11, 2015
Added to readme as of bf2983e.
@istx25 If you find anything, please just comment on this issue even though it's closed. Or even better. Make a gist and add a reference to it in the readme under Known Bugs :)
tciuro commentedon Jun 9, 2018
FWIW, all tests pass fine with the latest (public) version of Xcode: 9.4 (9F1027a)