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

[Thread-10] Multithreaded Table #31

Open
kjs1095 opened this issue Feb 8, 2018 · 0 comments
Open

[Thread-10] Multithreaded Table #31

kjs1095 opened this issue Feb 8, 2018 · 0 comments
Assignees
Labels
Milestone

Comments

@kjs1095
Copy link
Owner

kjs1095 commented Feb 8, 2018

  • Implement a thread-safe Table class, which stores a collection of untyped object pointers indexed by integers in the range [ 0. . size-1 ]. Table can be used to implement internal operating system tables for processes, threads, memory page frames, open files, etc.
  • Table has the following methods, defined in the header file Table.h:
    • Table(int size) -- Create a table to hold at most size entries.
    • int Alloc (void* object) -- Allocate a table slot for object, returning index of the allocated entry.
      Return an error (-1) if no free table slots are available.
    • void* Get (int index) -- Retrieve the object from table slot at index, or NULL if not allocated.
    • void Release (int index) -- Free the table slot at index.
  • Table class should be free from deadlock if used correctly.
@kjs1095 kjs1095 added the feature label Feb 8, 2018
@kjs1095 kjs1095 added this to the Project 2 milestone Feb 8, 2018
@kjs1095 kjs1095 self-assigned this Feb 8, 2018
@kjs1095 kjs1095 closed this as completed Mar 10, 2018
@kjs1095 kjs1095 reopened this Mar 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant