20-Apr-2024 00:25 GMT.
UNDER CONSTRUCTION
[News] POSIX threads ported to 68k AmigaANN.lu
Posted on 28-Jan-2004 22:27 GMT by whoosh28 comments
View flat
View list
straight clean port of Ralf S Engelschall's pth-1.4.0 a non pre-emptive implementation of POSIX threads to 68k Amiga. This is 2 gcc linker libraries to enable porting + writing of threaded programs to 68k Amiga. http://www.whoosh777.pwp.blueyonder.co.uk/pthreads.html To see a threaded program run on 68k Amiga download and run "the 5 philosophers":

http://www.whoosh777.pwp.blueyonder.co.uk/test_philo (requires just ixemul.library),

:this example program uses libpth.a,

The port itself is 2 gcc linker libraries: libpthread.a and libpth.a,

Last December I ported rpm4.0 with databases disconnected as database support required libpthread.a . So now I should be able to generate a full port of rpm4.0 (or higher) to 68k,

(its not at the top of my to-do list)

This port took only one day to do, an attempt at a totally different pre-emptive implementation of libpthread.a took well over a week before I gave up.

Anyway the consequence of this port of pth-1.4.0 is that it will enable porting of threaded programs. Probably noixemul progs will also be ok.

Even though it is only 1 days work I thought it was worth an announce as people always say the classic Amiga cant thread, well it can thread!

The most difficult thing was locating pth-1.4.0 as I didnt know it existed till I found it, I was only searching for libpthread.a

No idea if the example program will run on PPC or Amithlon, email me if you try it on such.

The advantage of being non-pre-emptive is that it is much more portable and clean. And if it implements POSIX threading (nightmare specification) it implements POSIX threading! (non-pre-emption notwithstanding) The source + necessary fixes to quite bugged configure are on http://www.whoosh777.pwp.blueyonder.co.uk/pthreads.html

List of all comments to this article
Sorted by date, most recent at bottom
Comment 1Golem29-Jan-2004 00:47 GMT
Comment 2Anonymous29-Jan-2004 08:28 GMT
Comment 3Anonymous29-Jan-2004 08:35 GMT
Comment 4Kjetil29-Jan-2004 10:44 GMT
Comment 5Thematic29-Jan-2004 11:50 GMT
POSIX threads ported to 68k Amiga : Comment 6 of 28ANN.lu
Posted by whoosh on 29-Jan-2004 16:53 GMT
@Golem,


why is it in the alpha directory?


and its been there for 2 years,


if all the test progs function then it should
never have even entered the alpha directory,


the fact its there suggests why,


rpm4.0 was also in the alpha
directory and totally malfunctioned. Thats why
I had to do my own port, my port is fully functioning
but has database support disconnected.


Anyway its too late now, I have ported a fully
functioning version,
I would never dream of putting my port in the
alpha directory,


alpha directory == problem directory,


Regarding pthread which is also in the above alpha directory,
well I have also generated a binary for pthread, but it crashes
on exit if any stdio function such as printf is used,
so *all* the test programs fail currently,
thats why I havent announced it and it would go into an alpha directory.


Its one thing to generate a binary, its quite another for it to
function.


@Kjetil quite!


threads share resources whereas tasks + processes dont,


so threads are analogous to say 3 people living in 1 house,


vs tasks and processes are analogous to 3 people living in
3 houses.


In a shared house you share resources such as bathroom and kitchen,
mutual exclusion can be done via keys. In separate houses the
entire house becomes a mutually excluded resource via a key.


If a program uses threads you cant just replace the thread calls
with CreateTask(), if only!


Re: why have non pre-emptive? if it satisfies the specification
for libpthread.a then what does it matter?


:non-pre-emptive doesnt need any platform specific code so
its going to be more safe as the same code will be tested
on all platforms.


Also non-pre-emptive is less fiddly so more likely to be safe,


I would like it to be pre-emptive, but so far there is some
impossible to find bug in the pre-emptive version. The pre-emptive
version needs a lot of tricky platform specific code and there
is no explanation of how to generate this.


BTW I have put some 7 example threaded programs on the site


http://www.whoosh777.pwp.blueyonder.co.uk/threaded_68kprograms.lha


so you can verify that its not an alpha,


whoosh
Jump...
#7 whoosh #8 Fabio Alemagna #13 Golem
TopPrevious commentNext commentbottom
List of all comments to this article (continued)
Comment 7whoosh29-Jan-2004 18:39 GMT
Comment 8Fabio AlemagnaRegistered user29-Jan-2004 19:51 GMT
Comment 9MarkTime29-Jan-2004 21:49 GMT
Comment 10whoosh30-Jan-2004 01:23 GMT
Comment 11Sigbjørn Skjæret30-Jan-2004 01:49 GMT
Comment 12Oppressor30-Jan-2004 01:56 GMT
Comment 13Golem30-Jan-2004 04:45 GMT
Comment 14Anonymous30-Jan-2004 09:10 GMT
Comment 15Anonymous30-Jan-2004 12:47 GMT
Comment 16whoosh30-Jan-2004 21:23 GMT
Comment 17Sigbjørn Skjæret31-Jan-2004 00:05 GMT
Comment 18Oppressor31-Jan-2004 03:56 GMT
Comment 19Kolbjørn Barmen31-Jan-2004 16:49 GMT
Comment 20whoosh01-Feb-2004 20:33 GMT
Comment 21Sigbjørn Skjæret01-Feb-2004 23:30 GMT
Comment 22whoosh02-Feb-2004 20:18 GMT
Comment 23Sigbjørn Skjæret02-Feb-2004 20:39 GMT
Comment 24whoosh02-Feb-2004 20:59 GMT
Comment 25whoosh02-Feb-2004 21:32 GMT
Comment 26whoosh04-Feb-2004 18:08 GMT
Comment 27whoosh04-Feb-2004 20:50 GMT
Comment 28whoosh05-Feb-2004 17:36 GMT
Back to Top