On Thu, Dec 27, 2012, at 04:47 PM, Michael Haberler wrote:
> I'm trying to find a good reason for the following:
> 
> - halcmd is also a HAL citizen with a temporary HAL module name (halcmdXXXX).
> - when halcmd loads a module by executing module_helper, it does the 
> following:
> -- disconnect from hal, destroying its on hal module
> -- it runs module_helper
> -- after its completion, it re-creates its temporary hal module
> 
> I fail to understand why - I would think it is good enough to release the 
> lock on the hal data segment while module_helper is running.
> 
> Any rationale for that?
> 

The short answer is probably "that was the easiest way to
make it work".  I think there are problems with the shared
memory mapping if you try to have it active during a fork.

I don't recall the details, but I think it was something like
the shared memory winds up belonging to the wrong
process.  Or maybe it winds up belonging to both, but 
of course the HAL housekeeping doesn't know that, and
when one of the processes ends, HAL closes the shared
memory, resulting in a segfault the next time the other
process tries to access it.

Whatever the details, the simplest solution was to
disconnect from shared memory, do the fork, then
reconnect afterwards.

Regards,

John Kasunich

------------------------------------------------------------------------------
Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and
much more. Get web development skills now with LearnDevNow -
350+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122812
_______________________________________________
Emc-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-developers

Reply via email to