You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
Return an error (-1) if no free table slots are available.
The text was updated successfully, but these errors were encountered: