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

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.

closed account (zb0S216C)
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.

struct ArrayWrapper
    int Array_[10];

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

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
closed account (zb0S216C)
Implementing the wrapper isn't difficult, but you may need to incorporate a library for the threads. Thing is, you may need to show your understanding of threads upon presentation of your wrapper. And no, there are no "keywords" for threads.

i downloaded c++11
how did you do that?

And yes C++11 supports keywords for thread:

i dont know how i did it or what it was that i downloaded, am really doubting myself now
Topic archived. No new replies allowed.