[GSOC] System V IPC in userspace week10 report

Grigore Larisa <[email protected]>
Newsgroups gmane.os.dragonfly-bsd.kernel
Message-ID <CAKt0zCzPC=yx-EOxdcaFXS52iuesMt6vL8c09WEX3AjJVjVmoQ@mail.gmail.com>
Hi all,

This week I have tested all I have implemented until now. Message queues
testing was a good way of testing shared memory and userland implementation
behavior when calling *fork*. Among others, I found some atypical behavior
when the parent removes the resource before the child finishes sysv
initialization (connect to daemon, inform about all resources used, etc)
and fixed it. I have also found scenarios when the memory used by clients
is not cleaned properly when another client removes a resource used by it.

Another bug was caused by using pthread_mutex/pthread_rwlock for
synchronizing access to semaphores and message queues. Those are
implemented using shared memory so sending a message or setting a semaphore
means writing in the shared memory area. Because more process can do this
(those using the sysv resource), a synchronization object is necessary. I
used pthread* but this can't work because
pthread_mutex_init/pthread_rwlock_init use malloc. To solve this issue I
have implemented a simple mutex inspired from pthread_mutex. Porting the
rwlock implies porting condition variables too.

Larisa
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.