Skip to content

[Proposal] Allow inserting a different thread by id with insert_real_time_thread #201

@timpalpant

Description

@timpalpant

When using real-time profiling, the signal is delivered (via broadcasting from the main thread) to the thread that called vmprof.enable(). To register additional threads, we can call insert_real_time_thread.

Currently, this function must be called from each thread that wants to be profiled, and then pthread_self is used to get the caller's thread ID.

Can we add an optional argument to the insert_real_time_thread function that allows registering a different thread by passing its id? This would be convenient in situations where it is difficult to get the desired thread to register itself. For example, we would like to be able to register the worker thread of a web server from a separate control interface.

This change would be backwards compatible, since by default (not passing the argument), the current thread ID would still be used.

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