Git Product home page Git Product logo

dse-thesis-task's Introduction

Programming task

  • Server
    • Servers requests from a client using a POSIX SHM. Synchronized interally using POSIX semaphores (see the comments in server.cpp)
$ # ./server <initial_size_of_hash_table>
$ ./server 10
$             [HashTable::HashTable]Creating a hash table with size: 10
              [HashTable::HashTable]Created a hash table with size: 10
  Listening to requests from Clients

Note: There is a lot of stuff printed out to the stdout.

  • Client
    • Sends requests to the server via a POSIX SHM and is synced using POSIX semaphores (see the comments in server.cpp)
$ # ./client <id> <operation> <key> <value>
$ ./client 123 insert 10 10
Starting the Client with key: 10 value: 20 id: 123 operation type: 1
Waiting to Write to SHM
Writing to SHM
Wrote to SHM: [OperationData]: id: 123 key: 10 value: 20 OperationType: 1 message:  status: 0
Waiting to Read from SHM
Reading from SHM
Read from SHM: [OperationData]: id: 123 key: 10 value: 20 OperationType: 1 message:  status: 0
Successfully performed operation
$ ./client read 10
Starting the Client with key: 10 value:  id: 123 operation type: 0
Waiting to Write to SHM
Writing to SHM
Wrote to SHM: [OperationData]: id: 123 key: 10 value:  OperationType: 0 message:  status: 0
Waiting to Read from SHM
Reading from SHM
Read from SHM: [OperationData]: id: 123 key: 10 value: 20 OperationType: 0 message:  status: 0
Successfully performed operation
Value for key: 10 is: 20
$ ./client delete 10
Starting the Client with key: 10 value:  id: 123 operation type: 2
Waiting to Write to SHM
Writing to SHM
Wrote to SHM: [OperationData]: id: 123 key: 10 value:  OperationType: 2 message:  status: 0
Waiting to Read from SHM
Reading from SHM
Read from SHM: [OperationData]: id: 123 key: 10 value:  OperationType: 2 message:  status: 0
Successfully performed operation
$ ./client 123 read 10
Starting the Client with key: 10 value:  id: 123 operation type: 0
Waiting to Write to SHM
Writing to SHM
Wrote to SHM: [OperationData]: id: 123 key: 10 value:  OperationType: 0 message:  status: 0
Waiting to Read from SHM
Reading from SHM
Read from SHM: [OperationData]: id: 123 key: 10 value:  OperationType: 0 message: Cannot find the key in the hash table.
 status: 1
Operation Failed: Cannot find the key in the hash table.

Note: There is a lot of stuff printed out to the stdout.


  • Hash Table

    • Uses chaining to address collisions
    • Internally synced using an RWLock (Preferring writers)
  • RWLock

    • Abstract type which can be extended for implementing different RWLocks - reader preferred, writer preferred
    • Currently suppporting a Writer Preferred RWLock

dse-thesis-task's People

Contributors

anand-krishna avatar

Watchers

 avatar

Forkers

pogobanane

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.