On Mar 5, 11:54 pm, wolffiex <[email protected]> wrote:
> Hi guys,
> Simple question: in 1.7R2, can I make a single instance of Parser and
> call its "parse" method from multiple threads, or do I need to guard
> calls to that method with a lock?

No, the Parser is not even reusable, so you can't even reuse a parser
after the first parse has completed, let alone while it is still
underway. Shouldn't be a problem though - parser creation is very
cheap, the expensive stuff is the parsing and compiling.

Looking at the code, we probably should make the Parser.parse()
methods synchronized in order to enforce this.

Hannes

> Thanks,
> A

_______________________________________________
dev-tech-js-engine-rhino mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino

Reply via email to