Too many users get bitten by what 'halcmd loadusr -W' does in the case
where their executable name and their hal component name don't match.

I propose changing "loadusr -W"'s behavior when -n is not also
specified, so that *any* component becoming ready causes loadusr's wait
to finish.

I've written this and pushed it to the branch jepler-halcmd-mindreader
on git.l.o.

There are two main concerns you might have.  First, from the user's
point of view, this is changing what "loadusr" does.  The rare
currently-working case it wuld affect is when
    loadusr -W somescript
actually creates two or more components, the latter of which is called
"somescript" and the former has some other name.  The user can correct
this by specifying the right component to wait for:
    loadusr -Wn somescript somescript
I suspect this kind of situation is very rare if it exists at all.

Second, from the technical side, an easy implementation involved using
the C++ std::set container.  halcmd did not previously have any source
files that were C++, so this is a bit of a change.  As we do currently
use C++, including a little bit of STL container usage, this isn't
something new in linuxcnc, but it does add it to another part of
linuxcnc that wasn't touched by C++ yet.  I don't think it's a big deal,
but I'm certainly open to other opinions.

I did consider simply counting ready components and waiting for the
count to increase, (getting rid of the need for a std::set and therefore
C++) but this wouldn't work in the situation that
    loadusr -W somescript
first removes a component (causing the number of components to decrease
e.g., from 3 to 2) and then loads a new one.  This sounds like an
uncommon setup, though I should note that halcmd itself *does* pull this
trick so actually I'm more concerned about this being encountered in
practice.

Hmm, so actually if somescript invokes 'halcmd loadusr ...' then halcmd
itself will be counted as the additional ready component.  Maybe this
idea isn't as foolproof as I'd hoped.  That detail is going to require
further consideration :-/

Jeff

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
_______________________________________________
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers

Reply via email to