Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Threads

Author: James Robertson

Date: 09:11:07 04/07/99

Go up one level in this thread


On April 07, 1999 at 04:38:06, David Blackman wrote:

>On April 07, 1999 at 01:52:06, James Robertson wrote:
>
>>Just out of curiosity, how would one port WIn32 stuff to, say, Unix or some
>>other system?
>>
>>James
>
>If it's written in C and uses only the ANSI C library calls it's easy. Hardest
>bit is usually to rewrite the makefiles since most Windows make commands don't
>follow the standard, and the compiler will probably want different command line
>arguments.
>
>If it's C++ and only uses ANSI library calls and doesn't push the latest stuff
>(Stroustrup 3rd edition) too hard, then the same story.
>
>If you use threads, then try to isolate all the thread specific code to one
>place, because the Posix thread calls are probably incompatible with the Windows
>ones. (I haven't tried this myself, but i think it's a safe bet.)
>
>If you use Windows specific OS calls to get at memory management, file io,
>networking, and stuff, then you can probably fake most of them on Unix, but try
>to avoid this where possible.
>
>If you have an elaborate Windows type user interface, then expect to have to
>rewrite the whole user interface for Unix. However you can get GUI toolkits such
>as Tk that are available for both Windows and Unix and require very few code
>changes between the two.

My program is a console application and uses very little of the Win32 functions.
But, I will have a hard time keeping my critical section stuff in one place.
Perhaps I could create macros and then have a separate file to #define what to
use?

James



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.