Skip to content

How can I define element size dynamically ? #442

@whatagoodname

Description

@whatagoodname

In my project, I need multiple producer threads to generate objects of a certain data type, and the size of this object is determined by an externally passed JSON during program runtime. However, it seems that our lock-free queue can only allocate memory based on the compile-time-specified T and sizeof(T)? I have tried using as T and then enqueuing n chars in bulk mode, but the speed is much slower compared to when T = std::array<char, n>. Is there any way for me to dynamically modify the element size recognized by the lock-free queue? Does this require modifying the source code to achieve?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions