What is a task queue in chrome

160 views
Skip to first unread message

18楼梦想改造家

unread,
Sep 23, 2023, 9:15:02 AM9/23/23
to Chromium-dev
Hey, I read the document.  Chromium Docs - Threading and Tasks in Chrome (googlesource.com).

And found this:

Note that SequencedTaskRunner::GetCurrentDefault() returns the default queue for the current virtual thread. On threads with multiple task queues (e.g. BrowserThread::UI) this can be a different queue than the one the current task belongs to. 

If I don't misunderstand anything:

OneThread==>task1->task2->task3 queue_a
                 ||
                 ==> task4->task5     queue_b

If we at task4 to call `|GetCurrentDefault|`, and `|queue_a|` is the default queue. we will return `|queue_a|` instead of `|queue_b|`. That't what the document want to say, Does I understand this right? or not.

And another question is , in chormium, which class map to `|queue_a|` and `|queue_b|`. Thx.

Min Qin

unread,
Sep 24, 2023, 11:54:47 AM9/24/23
to 18.flo...@gmail.com, Chromium-dev
GetCurrentDefault() just returns a TaskRunner, so the queue you mentioned depends on the actual implementation in the TaskRunner (thread pool, single thread, etc).  For example, base/task/sequence_manager/lazily_deallocated_deque.h 

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/d41cdcb3-8860-4686-a7a7-c8e715aca4ean%40chromium.org.
Reply all
Reply to author
Forward
0 new messages