Skip to content

multiple parallel linuxcnc sessions #2716

@rmu75

Description

@rmu75

As @rene-dev mentioned to me it is currently not possible to run tests in parallel, mainly because there can only be one linuxcnc instance running at a time. After investigating for a bit and looking at old branches in linuxcnc and machinekit I think such a feature could be realized with little effort.

CMS/NML uses SYSV shared memory buffer and semphores ("ipcs"), those resources are identified by a key (32bit integer) and those keys are derived from specification in the .nml file, usually those numbers are 1001-1005 or so.

HAL uses its own shared memory segments identified by key 0x48484c34 ("HHL"") and 0x48414c32 ("HAL "), halscope involves another one with hardcoded key, for testing purposes that should not be relevant.

So in order to run tests in parallel, either the sessions have to be isolated in some way such that each session gets it's own isolated SYSV ipc namespace (that would involve some linux namespace trickery and probably need root) or there has to be a mechanism to change the keys to non-overlapping unique values. AFAIK that should also be sufficient for parallel test runs in user space.

I propose using an environment variable like "LINUXCNC_INSTANCE" containing a number that is used as a kind of offset, e.g. first instance uses 0x48414c32 and 1001/1002/1003, second instance uses 0x49414c32 and 1011/1012/1013 and so on.

Please comment if I missed something. If this feature would be welcome and no major obstacles turn up I plan on implementing it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions