Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

stephenjudkins
Copy link
Contributor

Also fixes potential issue with Parsers.phrase not being reentrant; however, I was unable to actually reproduce this issue in practice. (The order in which lastNoSuccess was being set and compared seemed to guarantee that it would never actually be a problem).

Also fixes potential issue with Parsers.phrase not being reentrant; however, I was unable to actually reproduce this issue in practice. (The order in which lastNoSuccess was being set and compared seemed to guarantee that it would never actually be a problem).
@paulp
Copy link
Contributor

paulp commented Apr 2, 2012

Can you verify you have signed and submitted the contributor agreement at http://www.scala-lang.org/sites/default/files/contributor_agreement.pdf ?

@scala-jenkins
Copy link

jenkins job pr-scala-testsuite-linux-opt: Success - https://scala-webapps.epfl.ch/jenkins/job/pr-scala-testsuite-linux-opt/13/

@stephenjudkins
Copy link
Contributor Author

Hi, I have submitted my contributor agreement.

@paulp paulp merged commit dce6b34 into scala:master May 5, 2012
@paulp
Copy link
Contributor

paulp commented May 5, 2012

Sorry about the turnaround speed. You're in!

@dcsobral
Copy link
Contributor

dcsobral commented May 8, 2012

I'm sorry for barging in this late (the ticket did not have a component, so it escaped my filters), but was any benchmarking done? It seems to me that this would make Parsers much slower, and it isn't exactly a paragon of speed to begin with.

It seems to me that, in the course of a normal parsing, for each option considered and rejected, the following trade off happens:

Previously: var compared against null.

Now: lazy val have its DynamicVariable obtained, and a new closure is instantiated to map the resulting Option, which is then getOrElse extracted against true.

Now, if benchmarks show the resulting performance is about the same, I'm all for this patch. Otherwise, why not just mark Parsers as not thread-safe, and turn JSON object into a class?

@dcsobral
Copy link
Contributor

dcsobral commented May 8, 2012

At the very least, we could drop the lazy. Why make something lazy when all but the most trivial parser will use it?

@paulp
Copy link
Contributor

paulp commented May 8, 2012

See comment at https://issues.scala-lang.org/browse/SI-4929 .

@zsxwing
Copy link
Contributor

zsxwing commented Aug 23, 2015

I think Parsers is thread-safe since Scala 2.10. Right? It's hard to know it in SI-4929 since it was not closed explicitly.

@zsxwing
Copy link
Contributor

zsxwing commented Aug 23, 2015

We encountered the memory leak issue mentioned in SI-4929, and plan to change our Parsers to object (apache/spark#8357). Just want to make sure it's thread-safe in Scala 2.10 and Scala 2.11.

@SethTisue
Copy link
Member

Please open an issue at https://github.com/scala/scala-parser-combinators; the code no longer exists in this repo. Also, you have a better chance of getting expert help there.

milessabin added a commit to milessabin/scala that referenced this pull request Feb 13, 2017
Fixes Jekyll artefacts visible in README.md
milessabin pushed a commit to milessabin/scala that referenced this pull request Feb 13, 2017
szeiger pushed a commit to szeiger/scala that referenced this pull request Mar 20, 2018
Upper bound on the E type parameter of HashEntry
retronym referenced this pull request in retronym/scala Mar 24, 2020
Update SBT for the warn command, now assumed by sbt-extras
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants