
encached: caching server

What is needed for a cache server? Basically a hash table , network access to it and a means of deleting obsolete records .
To implement a hash table, I chose a binary tree (maybe not the best way) with chain- based collision resolution . The network interface was implemented using non-blocking sockets.
To work with the server, I sent a simple text protocol of three commands: GET, PUT, REMOVE.
Request key data:
GET
Answer options:
- NODATA \ r \ n
- DATA
\ r \ n
PUT
\ r \ n
Answer options:
- SUCCESS \ r \ n
- HIT \ r \ n (if the transferred data matches the data in the cache)
- FAILURE \ r \ n
REMOVE
Answer options:
- SUCCESS \ r \ n
- FAILURE \ r \ n
In the hope of an exciting joint development, I posted my developments on github. I really hope that I will find talented programmers among users of Habr. Project address on github: github.com/mdevils/encached
I would be grateful if you tell me a good way to organize a thread-safe hash table.
Server Development Plans
New teams: APPEND, PREPEND, INC, DEC, CAS (Compare and Swap), STAT, TAG (tag entry).
Full support for multithreaded write / read without locks.
Control of occupied memory.
Work under Windows.
Now the daemon runs on port 2332 under Linux (x86, x86_64), Mac OS X (x86, x86_64). It will probably work under BSD, I have no way to test it.
The server is built as usual - with the make command. It starts with the argument "-r". The machine must have FreePascal version 2.4.0 installed.
PS Happy New Year!