Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Conversation

dnadlinger
Copy link
Contributor

This avoids calling into pthread on switching fiber contexts
with a static runtime, which can be (comparatively) very
expensive (taking a kernel spinlock).

…hared library

This avoids calling into pthread on switching fiber contexts
with a static runtime, which can be (comparatively) very
expensive (taking a kernel spinlock).
@dnadlinger
Copy link
Contributor Author

@liranz

@dnadlinger
Copy link
Contributor Author

Ping @MartinNowak.

This leads to something like 30% (!) overall speedup in a fiber-heavy application.

@MartinNowak
Copy link
Member

It would be better to address the root cause, we shouldn't signal threads that are just about to start.
I'll see if it can be done easily w/o running into issues with the messy thread startup on Windows.

@dnadlinger
Copy link
Contributor Author

@MartinNowak: It's not like I add anything new here – the commit simply replaces version (Posix) by version (Posix && Shared). Once we have figured out the thread startup thing, we can just remove all the versioned code.

@dnadlinger
Copy link
Contributor Author

I could also argue that this is a critical fix for a regression introduced in 399b171 (2.066). We are talking about 30% whole-application performance here, not some sort of micro-benchmark.

@MartinNowak
Copy link
Member

Of course, all I'm saying is it looks fairly simple to do better, so I'll spend the hour trying to fix it properly.
In particularly b/c core.thread is in a horrible state w/ lots of ugly documented hacks.
For example I instantly found a bug just by thinking about this problem Issue 15268.

@MartinNowak
Copy link
Member

See #1421 and #1422, 50% reduction of messiness in core.thread ;).
I'm actually surprised it worked out so well (b/c I tried before). But once I decided to touch everything it was a pretty straightforward change.

@dnadlinger
Copy link
Contributor Author

Superseded by Martin's PRs.

@dnadlinger dnadlinger closed this Oct 31, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants