Skip to content

flac.Parse funcs are prone to data races #56

@zachorosz

Description

@zachorosz

Hello! Thanks for the wonderful library!

I'm trying to Parse multiple .flac files concurrently where each file is being parsed by its own goroutine (not multiple goroutines parsing 1 file). Getting some flakey results because readBytes func uses a global buffer and is prone to data races.

Is there any harm not using this global buffer? Could make a slice of size n in the func itself - would allocate it on the stack up until a certain size I think.

This is the commit that introduced this: e03baec (I know it's pretty old :/ )

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