Index:
[thread]
[date]
[subject]
[author]
From: Andreas Beck <becka@ggi-project.org>
To : davidws@csmctmto.interpoint.net
Date: Sat, 7 Aug 1999 14:00:02 +0200
Re: Shared GGI
> Hello,
> I have completed an alpha version of GGI in shared
> memory so multiple processes can share a single ggi_visual
> in the same fashion as getting a device context under windows.
Hmm. I actually do not see much use for it, but others might.
For my purposes I'd go with shmem-visuals and/or threads, but as said,
others might like the idea of setting up a visual in one process and using
it in some others.
> I have attached the code changes in a tar ball along with this
> email.
Thanks. I will put it up on ftp.ggi-project.org for public availability and
testing.
> The shared-libggi.README contains a list of changes that I did.
Thanks. I will include it below for the list to review.
> I had a problem adding new modules to the distribution so I
> modified ggi/visual.c to include the modules ggi/mempool.c
> ggi/shmem.c that I wrote so I could get them to compile.
autoconf is a bit tricky :-). We can take care of that.
> In include/ggi/ggi.h I placed the API that redirects all memory allocations
> to a pool of shared memory.
Hmm - so the question to the list is:
Should we try to merge that into the main distribution, or let it live as a
patch ?
If we include it: How ? I think a configure option would do well. A comment
in the README and a "patch-to-shmem" script would do as well.
Hmm - configure option is probably best, as you can then turn the option on
and off quite easily.
Oh - BTW. What's with LibGII ? The .tgz only contains LibGGI. That probably
means, that if you call a function that uses LibGII, it will follow a stale
pointer to normal RAM and thus crash in the cloned processes.
Comments, opinions ?
--- shared-libGGI.README --------
This is a port of GGI to shared memory that will allow for multiple
processes to share a ggi_visual_t directly in the fastest way possible
and is totally re-entrant.
Changes:
1) All calls to malloc within the display subdirectory where first changed
to _ggi_malloc, likweise all calls to free where changed to _ggi_free.
2) I wrote a memory manager shared memory contained in modules ggi/mempool.c
ggi/shmem.c which create a simple memory management system that supports
defragmentation and memory locking.
3) I added an API and placed the interface in include/ggi/gii.h which
redirects all calls to _ggi_malloc,_ggi_free,_ggi_realloc and _ggi_calloc
to shared memory.
So far preliminary tests work, I was able to do regression tests and nothing
broke and I was able to share a ggi display. I also was able to have one
process setup a ggi_visual and another one use it.
Thus you have the equivilant of a device context in windows.
David Schere
------------------------------
CU, Andy
--
= Andreas Beck | Email : <andreas.beck@ggi-project.org> =
Index:
[thread]
[date]
[subject]
[author]