Porting threaded app from NT to Linux and AIX

Porting threaded app from NT to Linux and AIX

Post by Scott Bur » Sat, 15 Jun 2002 20:23:30



I am about to port a few thread based Win32 apps from NT/2000 to Linux/AIX.
I am wondering what threading library I should utilize. Are POSIX threads
available on both ? Is this the way to go ?

Scott Burns

 
 
 

Porting threaded app from NT to Linux and AIX

Post by David Schwart » Sun, 16 Jun 2002 00:14:36



> I am about to port a few thread based Win32 apps from NT/2000 to Linux/AIX.
> I am wondering what threading library I should utilize. Are POSIX threads
> available on both ? Is this the way to go ?

        POSIX threads are available on both, but you're porting in the wrong
direction for that to help you much. It really depends how cleanly coded
the Win32 apps are. Ideally, you'd just replace the Win32-based
synchronization classes with corresponding POSIX classes. If instead raw
synchronization functions are scattered through the code, however,
you'll have a really tough time.

        It's hard to give you good advice without knowing more about the
applications.

        DS

 
 
 

Porting threaded app from NT to Linux and AIX

Post by Andrew Gabri » Sun, 16 Jun 2002 00:52:23




Quote:> I am about to port a few thread based Win32 apps from NT/2000 to Linux/AIX.
> I am wondering what threading library I should utilize. Are POSIX threads
> available on both ? Is this the way to go ?

AIX has POSIX threads (providing it's not too old a version).
Linux has a thread implementation with many of the same function
calls, but it's not POSIX compliant, and some of the symantics
are very POSIX non-compliant. If you are aware of the differences,
it is possible to write a program which works on both POSIX threads
and Linux. It's harder to do this if you just port to one first
without being aware of the differences and hence end up relying
on features or behaviours which differ between POSIX threads and
Linux.

--
Andrew Gabriel

 
 
 

Porting threaded app from NT to Linux and AIX

Post by Mikko Rauha » Sun, 16 Jun 2002 01:23:41




> AIX has POSIX threads (providing it's not too old a version).
> Linux has a thread implementation with many of the same function
> calls, but it's not POSIX compliant, and some of the symantics
> are very POSIX non-compliant.

And for the benefit of the original poster, the differences (mainly
related to signal handling) are explained in the LinuxThreads FAQ at
<URL:http://pauillac.inria.fr/~xleroy/linuxthreads/faq.html>.

--

              - WTA member - <URL:http://www.transhumanism.org/>

 
 
 

Porting threaded app from NT to Linux and AIX

Post by Dan Merc » Sun, 16 Jun 2002 01:40:38





>> I am about to port a few thread based Win32 apps from NT/2000 to Linux/AIX.
>> I am wondering what threading library I should utilize. Are POSIX threads
>> available on both ? Is this the way to go ?

>    POSIX threads are available on both, but you're porting in the wrong
> direction for that to help you much. It really depends how cleanly coded
> the Win32 apps are. Ideally, you'd just replace the Win32-based
> synchronization classes with corresponding POSIX classes. If instead raw
> synchronization functions are scattered through the code, however,
> you'll have a really tough time.

>    It's hard to give you good advice without knowing more about the
> applications.

>    DS

Also keep in mind that Win32 programmers use threads where UNIX
programmers use fork and exec - the overhead of forking a new
process on M$ being far greater tham on UNIX.

--
Dan Mercer

 
 
 

1. Windows NT|2000 Linux 2.2 port (was Linux apps in win2000 port news!)

For about two months, I've been busy working away at the possibility of a
native NT microkernel version of a Linux server. It's definitely doable. I'm
collecting information at the moment. I was sort of hoping until I had some
code (typical bizarre project style), but since Interix have beat the OSS
community to the punch, I may as well announce it now.

I'm looking at making the linux server (subsystem) at least passingly
similar to the current 2.2 tree, so that changes could be merged in there
closer . The goal obviously is to run native Linux x86 and Alpha binaries
(depending on platform) without recompilation.

My current idea is for a %windir%\linux\... tree that contains a vmlinux.exe
and the standard linux file system standard and enough stuff to launch bash.
Once launched, the server launches linux images as normal. A
modification/complete re-write of umsdos would provide the file system (or
maybe just use ext2fs until this is a bit more of a reality). By making a
directX fbconsole layer, we could re-use the frame buffer console code as it
exists today. X would come (much) later, but again via the use of the XAA
layer in XFree86 4.0 (I know it doesn't yet exist, but I helped write the
early 3.9 stuff, so I know it does exist :-)

The native NT api is exceptionally well hidden and undocumented, but
NT/W2k's microkernel is as least as good as Mach in all respects (and memory
and thread management, it's significantly better), so a mklinux server port
wouldn't take more than a year with dedicated people.

 If anyone's interested please drop me a line. You'd need to have a compiler
and a passing knowledge of Windows NT/2000 to be useful at this stage. I'm
going to use Visual C++ until I can prove to myself that cygnus's (or other)
gcc under WIn32 can do the job. The reason for this is the header files,
which are vital to Win32 development.

Andrew

2. Multi-Lingual support

3. Threads in linux versus threads in NT and threads in Solaris.

4. Apache 2 on AIX slow listening on multiple ports

5. weird network performance

6. Porting Solaris app to Linux -- RPC and threads

7. Help, I'm trying to find COM2

8. NT thread vs Linux thread...

9. Porting linux app to AIX

10. Help needed in porting AIX lex app to linux flex

11. Help needed in porting AIX lex app to Linux flex

12. HELP: Porting multi-threaded Sunos4.1.3 app. to Solaris