Closed Bug 1556861 Opened 5 years ago Closed 5 years ago

js::RunnableTasks should know their thread type

Categories

(Core :: JavaScript Engine, enhancement, P1)

enhancement

Tracking

()

RESOLVED FIXED
mozilla69
Tracking Status
firefox69 --- fixed

People

(Reporter: KrisWright, Assigned: KrisWright)

References

Details

Attachments

(1 file, 1 obsolete file)

Spidermonkey helper threads identify their thread type in their TaskSpecs[1], meaning it doesn't matter to Spidermonkey if a RunnableTask knows its own type or not. I noticed that XPCOM thread pools, which will not know what kind of RunnableTask it's accepting, will need some way to identify these types for prioritization and to avoid a shutdown race. If RunnableTask knows its own thread type then XPCOM will have access to that data - it can use the existing js::ThreadType[2] similarly to how TaskSpecs uses it to identify threads.

[1] https://searchfox.org/mozilla-central/rev/9eb2f739c165b4e294929f7b99fbb4d90f8a396b/js/src/vm/HelperThreads.cpp#2447
[2] https://searchfox.org/mozilla-central/rev/9eb2f739c165b4e294929f7b99fbb4d90f8a396b/js/public/Utility.h#64

Added thread type as ThreadType enum. Default is ThreadType::THREAD_TYPE_NONE. RunnableTasks must specify their own thread type.

Assignee: nobody → kwright
Priority: -- → P1

Added thread type as ThreadType enum. RunnableTasks must specify their own thread type.

Attachment #9070021 - Attachment is obsolete: true
Keywords: checkin-needed

Please ask for a review before we land this bug.

Removing checkin-needed for now.

Flags: needinfo?(kwright)
Keywords: checkin-needed

(In reply to Dorel Luca [:dluca] from comment #3)

Please ask for a review before we land this bug.

Removing checkin-needed for now.

The patch was reviewed by jonco above. For some reason phabricator did not link them even though it's the same patch. Is there some way in phab to carry over the accept? It's the same patch with the requested change made.

Flags: needinfo?(kwright)
Attachment #9070021 - Attachment is obsolete: false
Attachment #9070634 - Attachment is obsolete: true
Keywords: checkin-needed

Pushed by nbeleuzu@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/b26753fb35e7
Adding ThreadType to js::RunnableTask r=jonco

Keywords: checkin-needed
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla69
Blocks: 1559821
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: