[squeak-dev] Setting Memory pointer for bitmap object.. is it possible without plugin?

Marcel Taeumel marcel.taeumel at hpi.de
Thu Mar 30 07:47:12 UTC 2023


Hi --

I would use SqueakFFI and through that interface a system library for memory shared between processes. Maybe through memory-mapped files or similar...

https://learn.microsoft.com/en-us/windows/win32/memory/sharing-files-and-memory [https://learn.microsoft.com/en-us/windows/win32/memory/sharing-files-and-memory]

https://learn.microsoft.com/en-us/windows/win32/memory/creating-named-shared-memory [https://learn.microsoft.com/en-us/windows/win32/memory/creating-named-shared-memory]


Once you have your ExternalAddress for that shared memory region, you can start reading and writing bytes from multiple Squeak images. Watch out for synchronization/locking etc.

Best,
Marcel
Am 29.03.2023 21:11:28 schrieb LawsonEnglish <lenglish5 at cox.net>:
I decided to do a strange, but potentially very nifty thing, and share memory between two or more squeak applications on the Mac, but I find I can’t even get started…

What I’d like to do is manually set the pointer for a Bitmap in Image A so that it points to the same shared memory as the BitMap in Image B (and C and D and…)
and then display the Image Bitmap while B (C, etc) asynchronously draw into the same shared memory.
The immediate usecase would be doing a multi-process Mandelbrot Set drawing app where the Image A is for display and menu selection while the remaining Images
do the calculations and setting of pixels.
Is this doable out-of-the-box in Squeak, or must I write a plugin first?
If so, what do I need to do?

If I do need to write a plug-in, how do I do it. I’ve read on the wiki about the Surface Plugin, but not quite sure if that is what I need or not.

Thanks.


L

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20230330/2fb564fd/attachment.html>


More information about the Squeak-dev mailing list