i want to understand this -simple thread-safe wrapper for an array- inside out, where do i start?

devonrevenge (668)
i know basic c++ but the only word in
simple thread-safe wrapper for an array
i know is array

i would like to do this without installing a a library if i can help it, i downloaded c++11 and boost but i really don't know how to link things.

Framework (3113)
You can start by learning the terminology:-

Thread-Safe: Indicates that the implementation can handle simultaneous read/write operations by threads at any given time whilst avoiding dead-locks and/or race conditions. Note that a "dead-lock" is where two threads are waiting upon each other and a "race condition" is where two threads are trying to access the same resource at the same time (two people trying to get through one door at the same time).

Thread: A light-weight process (normally at user-level) that executes independently of the main process thread ("main( )") which created it. Threads are the core of multi-threading.

Wrapper: An implementation that provides an interface to another encapsulated implementation. The code below is an example of a wrapper.

1
2
3
4
5
6
7
struct ArrayWrapper
{
    int Array_[10];

    unsigned int Length( ) const;
    void Assign( int Index_, int Value_ );
};

Wazzak
devonrevenge (668)
so can i just straight up build this as though it was someting like a linked list or are there commands or libraries...i need a keyword that knows its running something dont i :/
Last edited on
Registered users can post here. Sign in or register to post.