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

#55 create class for database #55

Merged
merged 2 commits into from
Feb 8, 2023

Conversation

MikaelEdwartz
Copy link
Contributor

Added a class with some methods that we can fill with functionality.
The class is meant to represent the database which holds a key and value.

@MikaelEdwartz MikaelEdwartz linked an issue Feb 8, 2023 that may be closed by this pull request
@kappsegla
Copy link
Contributor

Sync this with #44. Locking of database should probably be moved into database methods so the same lock can be used for the database.

@MikaelEdwartz
Copy link
Contributor Author

Sync this with #44. Locking of database should probably be moved into database methods so the same lock can be used for the database.

Where should the lock be placed? Inside each function or in something like main (or the method) where we have a switch statement choosing what method to call?

@kappsegla
Copy link
Contributor

Sync this with #44. Locking of database should probably be moved into database methods so the same lock can be used for the database.

Where should the lock be placed? Inside each function or in something like main (or the method) where we have a switch statement choosing what method to call?

Each method in database manipulating the map should have the lock code in them, surrounding any calls to the map.
And the Lock object can be created once in the constructor, because it must be shared so all threads tries to lock on the same object

Copy link
Contributor

@jLereback jLereback left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! The formatting looks good 😋

Copy link
Contributor

@AntonLindskog96 AntonLindskog96 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

@kappsegla kappsegla merged commit 1363c3c into main Feb 8, 2023
@kappsegla kappsegla deleted the 54-create-class-for-storing-key-values branch February 8, 2023 12:27
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.

Create class for storing key values
4 participants