AdaCore / ada-traits-containers

Generic Ada Library for Algorithms and Containers
Other
29 stars 13 forks source link

Add protected pool #1

Closed AdaDoom3 closed 8 years ago

AdaDoom3 commented 8 years ago

Having simple protected containers would be hugely helpful for some of my projects and using a pool within your traits containers is a great way to eliminate a lot of cruft without having to wrap every single container package in a protected type as I am currently doing.

AdaDoom3 commented 8 years ago

Sorry for the duplicate commit, it is now corrected and the files are deleted.

briot commented 8 years ago

I'll take a look at your patches. The idea, in fact, will be to modify the containers to add a Locking_Policy generic parameter. This could be implemented by using protected types (slowest), atomic types and no locking (tricky to put in place, but faster), no locking at all (for single-threaded applications, fastest), and so on. This is an orthogonal configuration, independent from the storage policy, or checks_policy,... Thanks for the patches

briot commented 8 years ago

Can you use "git rebase -i" to merge the commits where appropriate, rather than commit a file to be removed immediately after ? That will keep the history cleaner.

AdaDoom3 commented 8 years ago

Thanks for the git advice : )

I like the idea of using the packages already in place and adding a parameter instead of making a separate container for each locking policy. I will close this pull request and see if I could contribute something along those lines.