Skip to content

第34题,表述不准确 #82

Closed
Closed
@liberalisman

Description

@liberalisman
Contributor

第34题,在面的描述中,讲到子线程的 RunLoop。

原文:
“子线程的 runloop 默认是不工作,无法主动创建,必须手动创建。”

可我看源代码,子线程默认是没有 RunLoop的,所以谈不上是否工作。如果需要在子线程开启 RunLoop ,则需要调用 [NSRunLoop CurrentRunLoop]方法,它内部实现是先检查线程,如果发现是子线程,以懒加载的形式 创建一个子线程的RunLoop。并存储在一个全局的 可变字典里。编程人员在 [NSRunLoop CurrentRunLoop]中,是自动创建 RunLoop 的,而没法手动创建。

不知道理解的是否正确,望指正。

Activity

deanyang506

deanyang506 commented on Jul 21, 2017

@deanyang506

这才是正解

liberalisman

liberalisman commented on Jul 21, 2017

@liberalisman
ContributorAuthor

谢谢认可

amisare

amisare commented on Aug 9, 2017

@amisare

最好pull request你的理解

liberalisman

liberalisman commented on Apr 16, 2018

@liberalisman
ContributorAuthor

针对不够严谨的内容,已经提了PR,但是看样子,原作者已经很少看这个主题了。

ChenYilong

ChenYilong commented on Jun 1, 2020

@ChenYilong
Owner

已经合并,谢谢更正

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @ChenYilong@amisare@liberalisman@deanyang506

        Issue actions

          第34题,表述不准确 · Issue #82 · ChenYilong/iOSInterviewQuestions