Soft-Interrupt passing messages to a Process.. examples?
Posted: Sun Mar 30, 2014 6:09 pm
Project=Perception-IME
Repository=http://code.google.com/p/perception-ime
Within the Perception/Library/daemon.c file I have two functions am I writing together at this time,
1= ExecInputHandler() /*called from input.device as a Soft-Interrupt*/
2=ProcInputHandler() /*called within the Perception-IME process context*/
And I have a complex data-structure that I am currently needing to share between the two contexts...
I am not interested in using Semaphores as my limited understanding is that Interrupts happen at any time so I can not allocate/free or obtain semaphores as they are all potentials for crashing the OS, however with the upcoming update to SMP awareness, What semantics would be safe to mark access to this data as being "shared" or a design pattern reference in using a data structure from multiple contexts safely?
I'm aware that the Soft-Int context may have that code run at any time, and the process only runs when signalled (possibly even being interrupted when running for the interrupt to execute...)
If this was a device setup I would want to work from an example but I lack information about design patterns that are safe for this work.
Would this be a case where Forbid() and Permit() would actually be good to use? to enable quickly copying the data concerned to work with?
I'm wanting to keep ExecInputHandler() as short as possible without introduction of anything dangerous,
and ProcInputHandler() being on the process context gives me the advantage of separation of the plugins for the IME from the input.device.
each plugin corresponds with a specific Language which has additional Input Modes (Existing languages only have a single input mode "Direct") for example,
Japanese would require multiple Input modes with a mix of "Direct" and "Translated" options.
The "translated" Mode options will require that an external to the IME plugin function be called to obtain a word from an input buffer along with translation candidates.
working up the plugin hook handling is going to be relatively easier than making the completed input handling imho, so I'm focusing on what seems more difficult for now.
As for "display" I have put some UTF8 strings pre-encoded into the Japanese.Language module already,
just GetLocaleStr() any of the 72 valid strings to ask for to receive a correct string to try displaying.
the IME will focus only on Input and nothing display related unless required.
Repository=http://code.google.com/p/perception-ime
Within the Perception/Library/daemon.c file I have two functions am I writing together at this time,
1= ExecInputHandler() /*called from input.device as a Soft-Interrupt*/
2=ProcInputHandler() /*called within the Perception-IME process context*/
And I have a complex data-structure that I am currently needing to share between the two contexts...
I am not interested in using Semaphores as my limited understanding is that Interrupts happen at any time so I can not allocate/free or obtain semaphores as they are all potentials for crashing the OS, however with the upcoming update to SMP awareness, What semantics would be safe to mark access to this data as being "shared" or a design pattern reference in using a data structure from multiple contexts safely?
I'm aware that the Soft-Int context may have that code run at any time, and the process only runs when signalled (possibly even being interrupted when running for the interrupt to execute...)
If this was a device setup I would want to work from an example but I lack information about design patterns that are safe for this work.
Would this be a case where Forbid() and Permit() would actually be good to use? to enable quickly copying the data concerned to work with?
I'm wanting to keep ExecInputHandler() as short as possible without introduction of anything dangerous,
and ProcInputHandler() being on the process context gives me the advantage of separation of the plugins for the IME from the input.device.
each plugin corresponds with a specific Language which has additional Input Modes (Existing languages only have a single input mode "Direct") for example,
Japanese would require multiple Input modes with a mix of "Direct" and "Translated" options.
The "translated" Mode options will require that an external to the IME plugin function be called to obtain a word from an input buffer along with translation candidates.
working up the plugin hook handling is going to be relatively easier than making the completed input handling imho, so I'm focusing on what seems more difficult for now.
As for "display" I have put some UTF8 strings pre-encoded into the Japanese.Language module already,
just GetLocaleStr() any of the 72 valid strings to ask for to receive a correct string to try displaying.
the IME will focus only on Input and nothing display related unless required.