Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upSplit global constellation receiver into two (script and compositor) #8356
Comments
|
After this change it will be easier to tell if there are risks of deadlocks between the constellation and the script tasks, since there won't be a confusing mix of "does script actually use the message type" variants to consider. |
|
We might want to add an additional I'll take a look at this issue over the weekend and see what I can do. |
Split chan and receiver_port into script and compositor flavors Partial #8356. Currently this doesn't build because of a lint denying me to user unsafe code, which unfortunately the select! macro falls under. Not sure what to do there. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8478) <!-- Reviewable:end -->
|
Quick question: will I run into type incompatibilities if I split fn run(&mut self) {
loop {
let request = {
let receiver_from_script = &self.script_receiver;
let receiver_from_compositor = &self.compositor_receiver;
select! {
msg = receiver_from_script.recv() => msg.unwrap(),
msg = receiver_from_compositor.recv() => msg.unwrap()
}
};
if !self.handle_request(request) {
break;
}
}
}and receiver_from_script has the type of |
|
Yep! This is why we we stuff like http://mxr.mozilla.org/servo/source/components/layout/layout_task.rs#482 in other places. |
Split ConstellationMsg into ScriptMsg and CompositorMsg Fixes #8356. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8530) <!-- Reviewable:end -->
There are a couple parts to this:
Constellation::run) select over the two receivers (seelayout_task.rsfor a similar model)Constellation::start)constellation_msg::Msgenum intoconstellation_msg::ScriptMsgandconstellation_msg::CompositorMsgenums that only contain the messages that are appropriate for each sender, and update the types of the various senders and receivers involved, and update all users of the newly-typed sendersCode: components/compositing/constellation.rs, components/msg/constellation_msg.rs