On Fri, 15 Sept 2023 at 13:19, Jiri Svoboda <[email protected]> wrote: > > Hi, > > for quite some time I've been toying with the idea of implementing some color > scheme / color editing support in the UI. However, I've been stuck on the > design of a color scheme change notification mechanism. > > I think I've finally broken through so I wanted to share my deliberations > so that I have a record of my thoughs. > > It is possible they might also apply to other similar problems and I come > to some interesting conclusions that could benefit other areas as well. > > Please let me know if you have any comments/suggestions. >
Hi Jiri, interesting thoughts. My way of looking at this is basically that any notification mechanism should be an integral part of the mechanism used to distribute the configuration, not a figurative afterthought layered on top of unrelated system. So if, say, you read configuration directly out of filesystem, the best way to detect changes is to subscribe to changes of the files you are reading. Obviously, adding that functionality to VFS would be nontrivial work, but to do otherwise would seem like a workaround for missing functionality rather than a self-contained solution. An alternative would be for the configuration to be hosted and managed by a server dedicated to the explicit purpose of hosting and managing configuration, in which case notification functionality is a natural extension. I.e. instead of writing new configuration to a file, the configuration GUI would use IPC to change individual configuration values, and the server would distribute those changes to subscribers. It would be an extra task in memory, which might not seem ideal, but as a microkernel operating system we already depend on a whole lot of individual tasks contributing to the system, so instead of focusing on the overhead of each individual contributing task, it would be more natural to just ensure that overhead is insignificant across the board and not care about it. That, to me, seems like a much more elegant solution. Besides, the idea of every libui user registering itself with locsrv seems quite far from the server's intended purpose. At first glance, it feels to me more like a hack, rather than an elegant solution. -- The Other Jiri _______________________________________________ HelenOS-devel mailing list [email protected] http://lists.modry.cz/listinfo/helenos-devel
