Mailing-List: contact cygwin-developers-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-developers-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin-developers AT sources DOT redhat DOT com Message-ID: <011c01c0b070$9f8ae6c0$0200a8c0@lifelesswks> From: "Robert Collins" To: Subject: pthreads Date: Mon, 19 Mar 2001 23:32:09 +1100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 X-OriginalArrivalTime: 19 Mar 2001 12:26:32.0139 (UTC) FILETIME=[D49E81B0:01C0B06F] Any objections if I do a little bit of housekeeping in pthread.h thread.cc & thread.h ? There's a few serious issues there with the type definitions (which I blindly followed for pthread_cond* - making it worse :[). I believe I can make it leaner and meaner, and more compatible/easy to build on in future.... Fortunately I believe this can be done without breaking existing compiled programs (I'll especially test for this). As a side effect it will make some of it 64 bit clean. Rob Details for those who care: At the moment we have an number of fixed size arrays of multi-thread items, that we store a int index into for some of the pthread types, and structs in userspace for the rest. The problem with structs is that we cannot change their size as we write more functionality in. (I went to do the patch for Norman Vine's question and realised I'd break the ABI). Fortunately all the useable structs are 4 bytes long, as are all the index's. All those types should be pointers to objects created in cygwin1.dll, not userland variables. The housekeeping includes two things: * change the typedefs to be pointers so we can work more freely in the future, * and rewrite the guts of thread.cc & thread.h to allocate new objects on the stack and store the pointer rather than an index. This also removes the overhead of walking the list for user space requests, and simplifies the code. I've done a check on the typedef changes in pthread.h, and all my precompiled thread test programs still work fine* - so I'm confident of the success of the change. * With the expected exception of pthread_cond* variable access. But that's not even in a snapshot yet, so I don't consider it a problem.