Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert the deprecation of set in SyncVar #7308

Closed
scabug opened this issue Mar 28, 2013 · 8 comments · Fixed by scala/scala#6319
Closed

Revert the deprecation of set in SyncVar #7308

scabug opened this issue Mar 28, 2013 · 8 comments · Fixed by scala/scala#6319

Comments

@scabug
Copy link

scabug commented Mar 28, 2013

For some very strange reason the set method of SyncVar has been marked for deprecation. Please remove the deprecation and do not deprecate the set method.

The set method is what makes SyncVar a var in the first place. If the SyncVar only has put, then it will effectively become a size 1 bounded queue and is no longer a variable.

SyncVar needs to act like a variable. There must be a way to set the variable twise without reading or clearing it in between.

It must support the following flow:

  • Thread 1 set variable to "a"
  • Thread 1 set variable to "b" (discards value "a")
  • Thread 2 read variable, get value "b"
  • Thread 1 set variable to "c" (discards value "b")
  • Thread 1 set variable to "d" (discards value "c")
  • Thread 2 read variable, get value "d"

Alternatively stop calling it a SyncVar, and rename it to BoundedQueue1

@scabug
Copy link
Author

scabug commented Mar 28, 2013

Imported From: https://issues.scala-lang.org/browse/SI-7308?orig=1
Reporter: Heikki Vesalainen (hvesalai)
Affected Versions: 2.10.1

@scabug scabug added the library label Apr 7, 2017
@scabug scabug added this to the Backlog milestone Apr 7, 2017
@SethTisue
Copy link
Member

SethTisue commented Mar 2, 2018

@hvesalai do you have a link to the PR that did the deprecation? curious about the history here

@NthPortal
Copy link

This issue needs to be resolved before scala/scala#6319 is merged, because this commit in that PR removes set and unset

@NthPortal
Copy link

It was deprecated in scala/scala#560, which fixed #5623

@hvesalai
Copy link

hvesalai commented Mar 2, 2018

@SethTisue I must say I have no recollection about this. Furthermore I grepped SyncVar from our code and we are not using it any more, so I have no vested interest. I think everybody is using the java atomic stuff.

@lrytz
Copy link
Member

lrytz commented Mar 2, 2018

Maybe @heathermiller has some memory of this (why were set and unset on SyncVar deprecated in scala/scala#560)?

@NthPortal
Copy link

Do we just close this as won't fix, at this point?

@SethTisue
Copy link
Member

I'm just about to that point... let's do one last thing, let's rub @viktorklang's lamp and see if he appears

@SethTisue SethTisue removed this from the Backlog milestone Mar 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants