Skip to content

Thread safety #26

@michaelletzgus

Description

@michaelletzgus

Hi,

there is a thread safety issues when loading files (binarywave, load) in parallel/async.

All theses global Wave1235- and BinHeader1235-Objects are not thread safe.

All occurrences should be wrapped into a function:

def make_BinHeader5():
    BinHeader5 = _Structure(  # `version` field pulled out into Wave
.
.
.
        ])
    return BinHeader5
def make_Wave5():
    Wave5 = _DynamicStructure(
.
.
.    
            make_BinHeader5(), 'bin_header',
                help='Binary wave header'),
.
.
.        ])
    return Wave5

In my case using load() in parallel, the _numpy.ndarray() failed due to mismatching shape an buffer sizes. The global objects messed up the meta data. This error only occured when loading files with different shapes in parallel.

Thank you
Michael

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions