cserve2 can't handle virtual files (mmap-only), by design.
Proper support can be added later on, but for now we might want
to just fallback to the normal cache functions.
Fixes photocam test
Images and Files can be discovered by the client scanner before they
are valid (aka. loaded or opened). We want clients to ignore all
shared objects that are not ready yet, as they are in an undefined
state (values and memory might be invalid).
Shared string indexes are not repacked, since they live in a
memory pool (where the indexes can be reused).
So, the index in the table is equal to their ID. Add initial
test to check if the item at index n has the ID n.
Use tags such as INDX, FONT, IMAG, FILE.
These can help debugging and for robustness, as they will
be visible in the memory dump.
Update generation_id after repack as well
Also, print shared arrays usage as it is sent as first message
upon connection to the server.
Add fonts to LRU and flush LRU as needed.
Seems to work okay. Could probably be finetuned a bit.
- Create one Glyph_Data array per Font_Entry
- Copy Font_Source descriptors in shared array
- Copy font entries in shared index
- Send font index path over socket
- Merge Font_Source and Font_Data in shared memory
- Send font index path on client connect
- Repack font index after free
- Pass font shm name to clients
DBG and INF messages pollute the logs and performance reports
from valgrind, let's disable them at build-time for better
benchmarking.
Fix other compilation warnings and clean code a bit
If the client exits while the server is loading fonts,
the font entry objects are accessed after being freed.
Note: This is not a proper fix. The race condition should still
be fixed, but delaying client deletion a bit might help for a while...
Read Image descriptors from the shared arrays
But, accessing the shared index can be a bit expensive, so
try to read from the socket before scanning the index,
without blocking.
- Send paths to all connected clients
- Send paths upon connection from a new client
- Client side:
- Fast find opened images
- Fast find loaded images
- Optimize load by skipping socket wait
Also, remap indexes when needed (file size changed)
When index file grows, the clients are not notified, so they
must constantly check that their mapping matches the current array
size.
- Move required struct definitions to common evas_cs2.h
- Open/close shm and map arrays to memory
Pretty stupid for now as it will close & reopen the shm files
even when unchanged.
- Check shm size and array header consistency
- Implement message send
- Send messages from server when calling repack()
Only import the C file for now.
Implement the following features:
- Shared Arrays
Store arrays of elements of fixed size in shm.
- Shared Mempool
Store random sized buffers in shm.
These buffers are indexed in a Shared Array and are
referred to using their index only.
- Shared Strings
Store strings in a shm in a way similar to Eina_Stringshare
(except strings are referred to using an int index).
- Include evas_cserve2_index.c to the compilation.
- Declare shared index functions in header file.
- Call init() and shutdown() on the shared index subsystem.
- Add find and foreach functions
- cserve2_shm_segment_request()
Creates a new shm segment (Shm_Handle) from an existing file,
without changing the current mmap.
- cserve2_shm_resize()
Grows the file and remaps in memory (new virtual address).
- cserve2_shm_id_get()
Returns the shm creation ID.