PPC Port - threads

Ok, I did some reading today, and found out why we’re having trouble with
the linuxthreads stuff.

On the GNU web site, it said that the threads addition is supported on
Linux/i386 (well, it actually says GNU/Linux :-), Linux/m86k and
Linux/alpha (And GNU hurd on all architechtures).

Then there was a note saying that it is being worked on for Linux/PPC and
Linux/Sparc :slight_smile:

Ok, so if we want it to work in the short-term for LinuxPPC, we have these
options:

  1. Write some PPC asm to replace the x86 clone.S
  2. Forget about the clone() call, and use fork() or something else.
  3. Help the linuxthreads/PPC people out

To me, 2 seems to be a quick fix, while somebody else works on 3 :slight_smile:

If you are worried about performance issues, don’t. On LinuxPPC, nothing
is optimized, that’s why they release 1000Mhz PPC processors :slight_smile:

Please, let me know if I’m mis-informed here (or just generally wrong :slight_smile:

Michael Samuel,

Surf-Net City - Internet Cafe and Internet Service Providers
Phone: +61 3 9593-9977
E-Mail:
WWW: http://www.surfnetcity.com.au/~michael/

  1. Write some PPC asm to replace the x86 clone.S

This is what was done for Sparc – well, taken from LinuxThreads, anyway. :slight_smile:
I’m surprised pthreads aren’t supported on Sparc. I’m guessing it has to
do with glibc and the latest kernel not compiling, rather than pthreads
itself.

  1. Forget about the clone() call, and use fork() or something else.

An ugly kludge, but possible. SDL threads would be disabled, naturally.

Actually, SDL can be compiled to use synchronous events.
The sound driver, however, requires threads or fork()+shmat()
It seems reasonable to support this for other UNIX systems
that aren’t as cool as Solaris and Linux. :slight_smile:

(Solaris support complete except for audio – I love pthreads. :slight_smile:

  1. Help the linuxthreads/PPC people out

This is the best solution.
Anyone? Anyone? :slight_smile:

If you are worried about performance issues, don’t. On LinuxPPC, nothing
is optimized, that’s why they release 1000Mhz PPC processors :slight_smile:

Heheh

See ya!
-Sam Lantinga (slouken at devolution.com)–
Author of Simple DirectMedia Layer -
http://www.devolution.com/~slouken/projects/SDL/

  1. Write some PPC asm to replace the x86 clone.S

This is what was done for Sparc – well, taken from LinuxThreads, anyway. :slight_smile:
I’m surprised pthreads aren’t supported on Sparc. I’m guessing it has to
do with glibc and the latest kernel not compiling, rather than pthreads
itself.

As I thought I wrote (but must have forgot):

They are working on threads, with Linux/Sparc and Linux/PPC

Anyway, hopefully njh will come up with something…

  1. Forget about the clone() call, and use fork() or something else.

An ugly kludge, but possible. SDL threads would be disabled, naturally.

Ugly kludge… so is X, Sendmail and all the most popular Unix programs
:slight_smile:

Actually, SDL can be compiled to use synchronous events.

Good. How long until you have a patch? :slight_smile:

The sound driver, however, requires threads or fork()+shmat()

It’s not like LinuxPPC has a 100% sound driver anyway :slight_smile:

It seems reasonable to support this for other UNIX systems
that aren’t as cool as Solaris and Linux. :slight_smile:

Yeah, but they’ll probably have lots of other system-dependant problems
anyway. (I still can’t get over that program that had #ifdef
AIX_BRAIN_DEATH spread right through it)

I suppose it couldn’t hurt though, as according to the clone man page, you
have 0 to no chance of using clone() on most systems :slight_smile:

Michael Samuel,

Surf-Net City - Internet Cafe and Internet Service Providers
Phone: +61 3 9593-9977
E-Mail:
WWW: http://www.surfnetcity.com.au/~michael/On Fri, 3 Apr 1998, Sam Lantinga wrote:

Ugly kludge… so is X, Sendmail and all the most popular Unix programs
:slight_smile:

Yeah, but… Qmail

Just because it’s UNIX doesn’t mean it has to be ugly. :slight_smile:

Actually, SDL can be compiled to use synchronous events.

Good. How long until you have a patch? :slight_smile:

It’s already supported. Call SDL_ThreadEvents(0); before calling
SDL_Init()

Doh! It’s loaded by SDL_Init(). I’ll post a patch ASAP.

It seems reasonable to support this for other UNIX systems
that aren’t as cool as Solaris and Linux. :slight_smile:

Yeah, but they’ll probably have lots of other system-dependant problems
anyway. (I still can’t get over that program that had #ifdef
AIX_BRAIN_DEATH spread right through it)

Solaris support was simple – a simple recompile and realizing that POSIX
threaded signal semantics are slightly different from Linux signal semantics.
Solaris supports (was the originator of) pthreads and dlopen, both of which
are used by SDL. The X11 video driver works unchanged.
The audio needs a bit of work, but the general framework doesn’t need to
be changed.

See ya!
-Sam Lantinga (slouken at devolution.com)–
Author of Simple DirectMedia Layer -
http://www.devolution.com/~slouken/projects/SDL/