System V message queue support
- Each server have two treads, one for main command receiver, with msgrcv,
- Other thread will wait for admin commands on own queue
- when admin receives shutdown and it knows that main thread is waiting on Q (synced via global flags), it should set some globals that shudown is requested, and perfrom pthread_kill on main thread.
- when there is incoming ping, the admin thread checks the main thread, if it is doing msgrcv, the reply to ping ok, if not , then save in globals that ping reply is pending and let main thread at reach of next msgrcv reply on ping
- we shall support rqaddr, meaning that server either listens on single queue or it's own queue. So unix mode on shared mem should be enabled by default (allowing servers run on their own queues or on shared queue)
- ndrxd should act correspondingly - if shared, then remove Q only if last servant is off
- there should be global read/write locks protected dictionary of System V queues and Posix queue names, so that everything else does not break on Enduro/X
#1 Updated by Madars Vitolins 3 months ago
For timeout handling, we shall also use pthread_kill() by background thread. This means that client process will require background thread too. As it might perform timed calls (like tpcall with timeout). As there could be many user threads, the timeout thread shall perform scheduler for them all.
#2 Updated by Madars Vitolins about 2 months ago
For socket processing (fd add extension) I guess we need another thread. So that if message comes in, we put big lock, so that other queues hold on their processing. While we get something. And basically the main thread while doing polling basically should wait for message to appear in some kind of buffer. Locks would be faster than pipes.