iOS 开发实用技术导航
NSHipster 中文版
http://nshipster.cn/
cocos2d 开源 2D 游戏引擎
http://www.cocos2d-iphone.org/
CocoaPods
http://cocoapods.org/
Google Analytics for Mobile 统计解决方案
http://code.google.com/mobile/analytics/
WWDC
https://developer.apple.com/wwdc/
Design Guides and Resources
https://developer.apple.com/design/
Transcripts of WWDC sessions
http://asciiwwdc.com
Cocoa with Love
http://cocoawithlove.com/
Cocoa Dev Central
http://cocoadevcentral.com/
NSHipster
http://nshipster.com/
Style Guides
Google Objective-C Style Guide
NYTimes Objective-C Style Guide
Useful Tools and Services
Charles Web Debugging Proxy
Smore
ultragtx
V2EX  ›  iDev

无脑用dispatch_queue有什么坏处么

  •  
  •   ultragtx ·
    ultragtx · Aug 10, 2012 · 4080 views
    This topic created in 5037 days ago, the information mentioned may be changed or developed.
    最近都在无脑用dispatch_queue,需要异步就开一个,能统一用一个queue就算相对不无脑的了。怀疑这样做会不会有什么问题,还是说dispatch_queue真的就这么方便。
    5 replies    1970-01-01 08:00:00 +08:00
    hoogle
        1
    hoogle  
       Aug 11, 2012
    感觉。。真的就那么方便。。
    keakon
        2
    keakon  
       Aug 12, 2012
    需要注意优先级,避免影响UI线程。
    myrual
        3
    myrual  
       Aug 12, 2012
    @keakon 全局queue应该用哪个优先级才不会影响到UI线程?
    laihj
        4
    laihj  
       Aug 12, 2012
    应该没什么问题,基本上不太可能影响到UI线程,UI线程都在主线程里,怎么都比你自己开的优先级高
    keakon
        5
    keakon  
       Aug 12, 2012
    @myrual 你可以查查 dispatch_queue_priority_t 这个类型。另外,我记得以前测试时,2 个并行子线程会显著影响主线程的效率,不过多核应该要好些。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3512 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 43ms · UTC 10:40 · PVG 18:40 · LAX 03:40 · JFK 06:40
    ♥ Do have faith in what you're doing.