Mailing-List: contact cygwin-developers-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-developers-owner AT cygwin DOT com Delivered-To: mailing list cygwin-developers AT cygwin DOT com X-Authentication-Warning: atacama.four-d.de: mail set sender to using -f Date: Wed, 11 Dec 2002 10:21:01 +0100 (=?ISO-8859-1?Q?Westeurop=E4ische_Normalzeit?=) From: Thomas Pfaff To: Robert Collins cc: cygwin-developers AT cygwin DOT com Subject: Re: quandary with pthreads In-Reply-To: <1039595969.1776.108.camel@lifelesswks> Message-ID: X-X-Sender: pfaff AT antarctica DOT intern DOT net MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="2363769-8797-1039598461=:294" This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime AT docserver DOT cac DOT washington DOT edu for more info. --2363769-8797-1039598461=:294 Content-Type: TEXT/PLAIN; charset=US-ASCII Rob, thank you that you are willing to add my patches. FYI, the logic of the mutex stuff is running in pthreads-win32 about 1 1/2 years now unchanged (guess who has contributed). I will try to add some of the testcases from pthreads-win32. I still see some problems with WIN95 since it lacks support for InterlockedCompareExchange which is required in pthread_mutex_trylock (and the fact that InterlockedIncrement and Decrement return only 0, positive or negative instead of the real counter value). I have created assembler versions for the Interlocked functions that work fine unless they are made inline (see attachment). Maybe someone with a better understanding of gcc inline assembler might have a look at it). Nevertheless adding these functions will drop support for the good old i386. Greetings, Thomas On Wed, 11 Dec 2002, Robert Collins wrote: > I *really* want to get Thomas's contribution properly reviewed in time > for 1.3.18. > > Unfortunately my cygwin development machine's hard drive is failing, and > it will be off the air for ~ 1 week. > > So, I'd like to suggest the following: > > Thomas.. > If you can write test cases for all the new capabilities you introduce - > see the ones I added based on your previous work, and the README in the > test-suite dir. > Then I will be happy to have your changes committed if the test suite > shows no pthreads regressions on a win9x machine, and on an NT kernel > based machine. > > Best I can offer right now, sorry. > Rob > > -- > --- > GPG key available at: http://users.bigpond.net.au/robertc/keys.txt. > --- > --2363769-8797-1039598461=:294 Content-Type: TEXT/plain; name="winbase.h" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename="winbase.h" I2luY2x1ZGVfbmV4dCAid2luYmFzZS5oIgoKI2lmZGVmIEVYUENHRgojZGVm aW5lIERFQ0xBUkVfVExTX1NUT1JBR0UgY2hhciAqKnRsc1s0MDk2XSBfX2F0 dHJpYnV0ZV9fICgodW51c2VkKSkKI2Vsc2UKI2RlZmluZSBERUNMQVJFX1RM U19TVE9SQUdFIGRvIHt9IHdoaWxlICgwKQojZGVmaW5lIF9XSU5CQVNFMl9I CiNlbmRpZgoKI2lmIGRlZmluZWQoX19JTlNJREVfQ1lHV0lOX18pICYmICFk ZWZpbmVkIChfX05PX0lOVEVSTE9DS0VEX18pCgojaWZuZGVmIF9fSU5URVJM T0NLRURfREVGSU5FRF9fCiNkZWZpbmUgX19JTlRFUkxPQ0tFRF9ERUZJTkVE X18KCiNpZmRlZiBfX2NwbHVzcGx1cwpleHRlcm4gIkMiIHsKI2VuZGlmCgps b25nIGlsb2NraW5jciAobG9uZyAqbSk7CmxvbmcgaWxvY2tkZWNyIChsb25n ICptKTsKbG9uZyBpbG9ja2V4Y2ggKGxvbmcgKnQsIGxvbmcgdik7Cmxvbmcg aWxvY2tjbXBleGNoIChsb25nICp0LCBsb25nIHYsIGxvbmcgYyk7CgojaWZk ZWYgX19jcGx1c3BsdXMKfQojZW5kaWYKCiN1bmRlZiBJbnRlcmxvY2tlZElu Y3JlbWVudAojZGVmaW5lIEludGVybG9ja2VkSW5jcmVtZW50IGlsb2NraW5j cgojdW5kZWYgSW50ZXJsb2NrZWREZWNyZW1lbnQKI2RlZmluZSBJbnRlcmxv Y2tlZERlY3JlbWVudCBpbG9ja2RlY3IKI3VuZGVmIEludGVybG9ja2VkRXhj aGFuZ2UKI2RlZmluZSBJbnRlcmxvY2tlZEV4Y2hhbmdlIGlsb2NrZXhjaAoj dW5kZWYgSW50Z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FZhbHVlCiNkZWZpbmUgVGxzU2V0VmFsdWUgbXlfdGxzc2V0dmFs dWUKI3VuZGVmIFRsc0ZyZWUKI2RlZmluZSBUbHNGcmVlIG15X3Rsc2ZyZWUK I2VuZGlmIC8qX1dJTkJBU0UyX0gqLwo= --2363769-8797-1039598461=:294 Content-Type: TEXT/plain; name="winbase.c" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename="winbase.c" I2luY2x1ZGUgIndpbnN1cC5oIgoKI2lmbmRlZiBfX05PX0lOVEVSTE9DS0VE X18KCmxvbmcgaWxvY2tpbmNyIChsb25nICptKQp7CiAgaW50IF9fcmVzOwog IF9fYXNtX18oIlxuXAogICAgbW92bCAkMSwlMFxuXAogICAgbG9jayB4YWRk ICUwLCglMSlcblwKICAgIGluYyAgJTBcbiIKICAgIDogIj1hIiAoX19yZXMp LCAiPXEiIChtKQogICAgOiAiMSIgKG0pCiAgICA6ICJtZW1vcnkiICk7CiAg cmV0dXJuIF9fcmVzOwp9Cgpsb25nIGlsb2NrZGVjciAobG9uZyAqbSkKewog IGludCBfX3JlczsKICBfX2FzbV9fKCJcblwKICAgIG1vdmwgJDB4ZmZmZmZm ZmYsJTBcblwKICAgIGxvY2sgeGFkZCAlMCwoJTEpXG5cCiAgICBkZWMgICUw XG4iCiAgICA6ICI9YSIgKF9fcmVzKSwgIj1xIiAobSkKICAgIDogIjEiICht KQogICAgOiAibWVtb3J5IiApOwogIHJldHVybiBfX3JlczsKfQoKbG9uZyBp bG9ja2V4Y2ggKGxvbmcgKnQsIGxvbmcgdikKewogIGludCBfX3JlczsKICBf X2FzbV9fKCJcblwKMTogIGxvY2sgY21weGNoZ2wgJTMsKCUxKVxuXAogICAg am5lIDFiXG4iCiAgICA6ICI9YSIgKF9fcmVzKSwgIj1xIiAodCkKICAgIDog IjEiICh0KSwgInEiICh2KSwgIjAiICgqdCkKICAgIDogIm1lbW9yeSIgKTsK ICByZXR1cm4gX19yZXM7Cn0KCmxvbmcgaWxvY2tjbXBleGNoIChsb25nICp0 LCBsb25nIHYsIGxvbmcgYykKewogIGludCBfX3JlczsKICBfX2FzbV9fKCJc blwKICAgIGxvY2sgY21weGNoZ2wgJTMsKCUxKVxuIgogICAgOiAiPWEiIChf X3JlcyksICI9cSIgKHQpCiAgICA6ICIxIiAodCksICJxIiAodiksICIwIiAo YykKICAgIDogIm1lbW9yeSIgKTsKICByZXR1cm4gX19yZXM7Cn0KCiNlbmRp ZiAvKl9fTk9fSU5URVJMT0NLRURfXyovCg== --2363769-8797-1039598461=:294--