delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1997/06/11/21:06:29

From: mka AT redes DOT int DOT com DOT mx (Michael Anderson)
Subject: Re: What threads are available?
11 Jun 1997 21:06:29 -0700 :
Approved: cygnus DOT gnu-win32 AT cygnus DOT com
Distribution: cygnus
Message-ID: <339F1B18.5A58A920.cygnus.gnu-win32@redes.int.com.mx>
References: <01BC7699 DOT 59DEAA90 AT rem18 DOT co DOT rmit DOT edu DOT au>
Mime-Version: 1.0
X-Mailer: Mozilla 3.01 (X11; I; Linux 2.0.12 i586)
Original-To: Mark A Gregory <m DOT gregory AT rmit DOT edu DOT au>
Original-CC: gnu-win32 AT cygnus DOT com
Original-Sender: owner-gnu-win32 AT cygnus DOT com

Mark A Gregory wrote:
> 
> Hi,
> 
> I have a program that I am converting from UNIX and it uses the pthread
> calls.
> 
> Does anyone know how to convert these to something that will work using the
> cygnus tools?

I do have such a beast, although it is not in the form of a Unix layer,
but rather uses abstraction functions of this form:

int CreateMyThread( ... )
{
	...
#ifdef WINNT
	thread = CreateThread( ... );
#endif
#ifdef UNIX
	thread = pthread_create( ... );
#endif
	...
}

I have most of the pthread functionality including mutexes and condition
variables coded and semi-tested on WinNT. Converting these functions to
the Unix layer approach should be simple since I used the pthreads
arguments as the arguments to the functions.

However I'm swamped to the gills with my current workload and I don't
have time to look into this. I also haven't yet figured-out the
licensing issues on making the code or objects available - the GPL is
much too restrictive. If you're in a hurry, you could code these up
yourself, the Win32 approach is simpler than the pthreads way of doing
certain operations such as counting semaphores. I used the following
references:

Advanced Windows by Jeffrey Richter, Microsoft Press ISBN 1-55615-677-4

Practical Unix Programming by Robbins/Robbins, Prentice Hall
	ISBN 0-13-443706-3


-- 

Mike Anderson
mka AT redes DOT int DOT com DOT mx
Guanajuato, GTO, Mexico
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019