Skip to content

Long waiting time for other async thread? #27

@wangzhijiang-nreal

Description

@wangzhijiang-nreal

Just be curious, what if an action is (computationally) heavy, does other thread wait for a long time for the lock to be released?

// UnityMainThreadDispatcher.cs

public void Update() {
    lock(_executionQueue) {
        while (_executionQueue.Count > 0) {
            _executionQueue.Dequeue().Invoke();
        }
    }
}

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

    Issue actions