Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An alternative approach to threads naming #3375

Merged
merged 2 commits into from
Feb 17, 2019

Conversation

opensource-kymetacorp
Copy link
Contributor

Pull Request Notice

Before sending a pull request make sure each commit solves one clear, minimal,
plausible problem. Further each commit should have the following format:

Problem: X is broken

Solution: do Y and Z to fix X

Please try to have the code changes conform to our coding style. For your
convenience, you can install clang-format (at least version 5.0) and then
run make clang-format-check. Don't fix existing issues, if any - just
make sure your changes are compliant. make clang-format-diff will
automatically apply the required changes.
To set a specific clang-format binary with autotools, you can for example
run: ./configure CLANG_FORMAT=clang-format-5.0

Please avoid sending a pull request with recursive merge nodes, as they
are impossible to fix once merged. Please rebase your branch on
zeromq/libzmq master instead of merging it.

git remote add upstream git@github.com:zeromq/libzmq.git
git fetch upstream
git rebase upstream/master
git push -f

In case you already merged instead of rebasing you can drop the merge commit.

git rebase -i HEAD~10

Now, find your merge commit and mark it as drop and save. Finally rebase!

If you are a new contributor please have a look at our contributing guidelines:
CONTRIBUTING

FIRST TIME CONTRIBUTORS PLEASE NOTE

Please add an additional commit with a relicensing grant.

Example

More information on RELICENSING effort

Solution:
1. Use optional name parameter in thread_t::start for operating
systems that have thread names.
2. Give start_thread() an optional name parameter for the
thread's name. If this parameter is set, it will be appended to "0MQ:".
If not set, "0MQ" will be used as the thread's name.
3. Give epoll the ability to name its thread. Then use this in
io_thread and reaper to name them.
@opensource-kymetacorp opensource-kymetacorp changed the title An alternative approach to threads naming. Allows to set thread name in the "start" method. Threads started through the context have a default name even if name wasn't explicitly specified. Gives epoll the ability to name its thread. io_thread and reaper name their threads automatically. An alternative approach to threads naming Jan 30, 2019
@opensource-kymetacorp
Copy link
Contributor Author

An alternative approach to threads naming.
Allows to set thread name in the "start" method.
Threads started through the context have a default name even if name wasn't explicitly specified.
Gives epoll the ability to name its thread.
io_thread and reaper name their threads automatically.

@bluca
Copy link
Member

bluca commented Jan 30, 2019

Thanks for the PR. pthread_set_name_np, as the name says, it's not part of posix so this will break all platforms other than Linux. There's already a method to set the thread name in a platform compatible way that can be used

@bluca
Copy link
Member

bluca commented Jan 30, 2019

I think this will break the existing ZMQ_THREAD_NAME_PREFIX API, as it overwrites the name, won't it?

@bluca bluca merged commit 484374f into zeromq:master Feb 17, 2019
@bluca
Copy link
Member

bluca commented Feb 17, 2019

I'll fix those after merging in #3411

@opensource-kymetacorp
Copy link
Contributor Author

opensource-kymetacorp commented Mar 22, 2019 via email

@bluca
Copy link
Member

bluca commented Mar 22, 2019

I have adapted and fixed up your patch via #3411 so it now works everywhere

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants