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

use the typical Base functions instead of declaring new ones (e.g. get, put, release, etc) #91

Closed
Krastanov opened this issue Jul 28, 2023 · 1 comment · Fixed by #93

Comments

@Krastanov
Copy link
Member

@BenLauwens , to make it easier to interoperate with other packages, I would like to start using the Base.get and Base.put! functions instead of the ConcurrentSim.get and ConcurrentSim.put.

For get this is actually already the case.

For put!, I suggest that we move all ConcurrentSim.put implementations to Base.put! implementations and keep ConcurrentSim.put as a wrapper around Base.put! with a deprecation warning (a deprecation that would not be acted upon for many years if ever, and that shows up only when someone runs tests, not in typical use, as it seems to be the convention for most Julia packages).

Let me know if you disagree with this approach.

@Krastanov
Copy link
Member Author

There are a few more mismatches, mostly arising from the age of the package (back then, Julia itself did not have a very consistent API). These are very similar to the issues that DataStructures has over the last few years as they are slowly trying to release a 1.0 version (see JuliaCollections/DataStructures.jl#479)

  • Base.lock (instead of ConcurrentSim.request)
  • Base.trylock (no corresponding method in ConcurrentSim)
  • Base.put! (instead of ConcurrentSim.put)
  • Base.pop! (instead of the currently used Base.get -- see DataStructures issue for discussion)
  • Base.islocked (no corresponding method)
  • Base.isready (no corresponding method)
  • Base.unlock (instead of ConcurrentSim.release)

@Krastanov Krastanov changed the title use the Base get and put names use the typical Base functions instead of declaring new ones (e.g. get, put, release, etc) Jul 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant