On 6 May 2015 at 04:58, Doug Turner <do...@mozilla.com> wrote:

>
> > On May 5, 2015, at 12:55 PM, Jonas Sicking <jo...@sicking.cc> wrote:
> >
> > On Thu, Apr 30, 2015 at 3:34 PM, Valentin Gosu <valentin.g...@gmail.com>
> wrote:
> >> As some of you may know, Rust is approaching its 1.0 release in a
> couple of
> >> weeks. One of the major goals for Rust is using a rust library in Gecko.
> >> The specific one I'm working at the moment is adding rust-url as a safer
> >> alternative to nsStandardURL.
> >
> > Will this affect our ability to make nsStandardURL thread-safe?
>

Unfortunatelly this project does not make nsStandardURL thread safe. It is
only meant to prove Rust can be used in mozilla-central, and bring a little
extra safety to our URL parsing.


> >
> > Right now there are various things, mainly related to addons, that are
> > forcing us to only use nsIURI on the main thread. However this is a
> > major pain as we move more code off the main thread and as we do more
> > IPC stuff.
>

This involves changing the API used to create and change URIs and would
probably require all the consumers of nsIURI to alter their code.


> >
> > We've made some, small, steps towards providing better addon APIs
> > which would enable us to make nsIURI parsing and handling possible to
> > do from any thread.
> >
> > Would this affect this work moving forward? Or would a Rust
> > implemented URL-parser/nsIURI be possible to use from other threads
> > once the other blockers for that are removed?
>

The rust code is meant to be a drop-in replacement for our current parsing
code. A thread safe URI implementation should be able to use the rust code
without any issues.


> Valentin, if you’re serious about this effort, lets start by collecting
> requirements of this rewrite.  Thread safety is important.  Compat and
> correctness (talk to Anne!).  Performance


Thread safety has been on Necko's wish list for a while now, but this
project isn't going to fix it.
Compatibility with our current implementation is my main concern.
Performance might also benefit from this project, as our current
implementation does multiple iterations to parse a URI. I expect a slight
improvement.
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to