Skip to content

Implement pthread_cond_t with Win32 CONDITION_VARIABLE#1214

Merged
dscho merged 3 commits intogit-for-windows:masterfrom
rongjiecomputer:master
Aug 15, 2017
Merged

Implement pthread_cond_t with Win32 CONDITION_VARIABLE#1214
dscho merged 3 commits intogit-for-windows:masterfrom
rongjiecomputer:master

Conversation

@rongjiecomputer
Copy link

Win32 CONDITION_VARIABLE has better performance and is easier to maintain.

Since CONDITION_VARIABLE is not available in Windows XP and below, old implementation of pthread_cond_t is kept under define guard 'GIT_WIN_XP_SUPPORT'. To enable old implementation, build with make CFLAGS="-DGIT_WIN_XP_SUPPORT".

If I build with make CFLAGS="-D_WIN32_WINNT=0x0600 or change the define in git-compat-util.h, I will get many warnings and errors about symbols in compat/poll/poll.h are redefined because winsock2.h define them already when _WIN32_WINNT=0x0600.

I choose the simpler solution: keep the old _WIN32_WINNT and declare the 4 required Win32 functions in pthread.c.

Win32 CONDITION_VARIABLE has better performance and is easier to
maintain.

Since CONDITION_VARIABLE is not available in Windows XP and below,
old implementation of pthread_cond_t is kept under define guard
'GIT_WIN_XP_SUPPORT'. To enable old implementation, build with
make CFLAGS="-DGIT_WIN_XP_SUPPORT".

Signed-off-by: Loo Rong Jie <loorongjie@gmail.com>

fast-forwarded.
Signed-off-by: Loo Rong Jie <loorongjie@gmail.com>
@rongjiecomputer
Copy link
Author

See also for bumping bumped _WINNT_VER to 0x600: #1188 (comment)

@rongjiecomputer
Copy link
Author

@dscho Ping?

return t;
}

#ifdef GIT_WIN_XP_SUPPORT

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

Signed-off-by: Loo Rong Jie <loorongjie@gmail.com>
@dscho dscho merged commit eead5ec into git-for-windows:master Aug 15, 2017
@dscho
Copy link
Member

dscho commented Aug 15, 2017

Thank you so much!

dscho added a commit that referenced this pull request Aug 15, 2017
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
dscho added a commit to git-for-windows/build-extra that referenced this pull request Aug 16, 2017
The XP-compatibility layer emulating pthreads (which is [no longer
needed](https://git-for-windows.github.io/requirements.html)
[was dropped in favor of modern Windows threading
APIs](git-for-windows/git#1214); This should
make threaded operations slightly faster and more robust.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho added a commit that referenced this pull request Aug 18, 2017
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
git-for-windows-ci pushed a commit that referenced this pull request Aug 18, 2017
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
git-for-windows-ci pushed a commit that referenced this pull request Aug 20, 2017
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
dscho added a commit that referenced this pull request Aug 22, 2017
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
git-for-windows-ci pushed a commit that referenced this pull request Aug 23, 2017
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
git-for-windows-ci pushed a commit that referenced this pull request Aug 24, 2017
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
git-for-windows-ci pushed a commit that referenced this pull request Aug 24, 2017
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
git-for-windows-ci pushed a commit that referenced this pull request Aug 24, 2017
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
git-for-windows-ci pushed a commit that referenced this pull request Aug 24, 2017
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
git-for-windows-ci pushed a commit that referenced this pull request Aug 25, 2017
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
git-for-windows-ci pushed a commit that referenced this pull request Aug 25, 2017
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
dscho added a commit that referenced this pull request Aug 26, 2017
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
git-for-windows-ci pushed a commit that referenced this pull request Sep 20, 2017
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
dscho added a commit that referenced this pull request Sep 20, 2017
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
git-for-windows-ci pushed a commit that referenced this pull request Sep 21, 2017
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
git-for-windows-ci pushed a commit that referenced this pull request Sep 21, 2017
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
git-for-windows-ci pushed a commit that referenced this pull request Sep 26, 2017
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
git-for-windows-ci pushed a commit that referenced this pull request Sep 26, 2017
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
dscho added a commit that referenced this pull request Sep 26, 2017
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
dscho added a commit that referenced this pull request Oct 17, 2017
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
dscho added a commit that referenced this pull request Oct 19, 2017
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
dscho added a commit that referenced this pull request Oct 19, 2017
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
dscho added a commit that referenced this pull request Oct 19, 2017
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
dscho added a commit that referenced this pull request Oct 19, 2017
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
dscho added a commit that referenced this pull request Oct 19, 2017
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
git-for-windows-ci pushed a commit that referenced this pull request Oct 20, 2017
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
git-for-windows-ci pushed a commit that referenced this pull request Oct 20, 2017
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
git-for-windows-ci pushed a commit that referenced this pull request Oct 20, 2017
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
dscho added a commit that referenced this pull request Oct 20, 2017
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
git-for-windows-ci pushed a commit that referenced this pull request Oct 21, 2017
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
dscho added a commit that referenced this pull request Oct 23, 2017
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
git-for-windows-ci pushed a commit that referenced this pull request Oct 24, 2017
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
dscho added a commit that referenced this pull request Oct 30, 2017
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
dscho added a commit that referenced this pull request Nov 1, 2017
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
dscho added a commit that referenced this pull request Nov 6, 2017
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
git-for-windows-ci pushed a commit that referenced this pull request Nov 7, 2017
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
dscho added a commit that referenced this pull request Nov 29, 2017
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
git-for-windows-ci pushed a commit that referenced this pull request Dec 6, 2017
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
dscho added a commit that referenced this pull request Jan 2, 2018
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
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.

3 participants