Repository navigation
interp: let go of the kinematics HAL component at exit - #4891
grandixximo wants to merge 2 commits into
Conversation
The interpreter attaches a HAL component, `interp.<pid>`, the first time it evaluates the kinematics, and releases it only in its destructor. Task exits without destroying the interpreter, so the component outlived milltask and the linuxcnc script's shutdown waited out its 2 s loop for it. Interp::exit() now releases it; a later use loads it again. tests/ptp-robot, which evaluates the kinematics, takes 1.9 s instead of 3.9 s.
|
In kins_release you have: linuxcnc/src/emc/rs274ngc/interp_workplane.cc Lines 655 to 659 in 65f7467 The problem is that a component ID of zero (0) is actually a valid component ID. Not likely you'd ever see it, but valid. Normally, this field is initialized with |
HAL component id 0 is valid, so 0 cannot stand for "none". Start kins_comp_id at -1 and release any id >= 0.
|
Right, thanks. That came in with #4842; 0 was the "none" marker. I pushed a commit on this PR that starts |
|
No prob... |
|
The link itself is not new: librs274 has linked liblinuxcnchal since I agree the interpreter should not carry it, though. The cleaner shape is to ask canon for the kinematics, like |
|
The Then we can retry to enable |
|
Thanks, I will fix the outstanding todos on that one tonight. |
The interpreter attaches a HAL component,
interp.<pid>, the first time it evaluates the kinematics (G68.2, theG53.xcodes,G43.5, a move checked against the joint limits). It released it only in its destructor, and task exits without destroying the interpreter. The component outlived milltask, so thelinuxcncscript's shutdown waited out its 2 s loop for every component to go.Interp::exit(), which task calls at shutdown, now releases it. A later use loads it again.I added no test, since the change is in how long shutdown takes. Measured:
tests/ptp-robot, which evaluates the kinematics, takes 1.9 s instead of 3.9 s; a test that never evaluates them is unchanged. The suite passes.