Skip to main content
Home Forums 68kMLA Firefox 5 not on Tiger PowerPC :( — #12
Post #12 by PowerPup
Source Forum68kMLA
CategoryPowerPC
Post DateSat, 4 Jun 2011 - 07:12
Original URLhttps://68kmla.org/bb/threads/firefox-5-not-on-tiger-powerpc.23115/
Post
Seeing how posix_spawn() (or for 10.4 the lack thereof,) is one of the issues with compiling Firefox 4 & 5 (and future versions.) I thought I'd do a little googling and learn some more for myself.

I learned (and am explaining it for the benefit of non-programmers like me,) that posix_spawn() creates a new child process without having to fork (clone) the parent process. Using the method before posix_spawn(), which is a combination of fork() and exec(), would be slow and inefficient as it would have to make an entire copy of Firefox before replacing it with the appropriate plugin. (QuickTime, Flash, etc.)

So I ventured on to see if the was a way to create a child process without forking besides posix_spawn()... And there doesn't seem to be. Which seems really weird to me because it would seem to me that that kind of function would have been implemented in Posix systems a long time ago when memory was limited. (But then again, programs were smaller. :p )

I did find the following on opengroup.org:

The posix_spawn() function is implementable as a library routine,* but both posix_spawn() and posix_spawnp() are designed as kernel operations. Also, although they may be an efficient replacement for many fork()/ exec pairs, their goal is to provide useful process creation primitives for systems that have difficulty with fork(), not to provide drop-in replacements for fork()/ exec.
* --Underline added by me.
So it sound like it is theoretically possible to add posix_spawn() as a library, making it unnecessary to do any modification to the system... At least, it sounds possible...

Ooo, I just found this: http://stackoverflow.com/questions/4463283/managing-process-forks-in-c-in-linux-unix/4463468#4463468 (Comment #2.)

Note that on systems without posix_spawn, it's trivial to implement it as a library routine on top of fork (or better yet, on top of vfork if it's available)
(Which vfork() has been around since 10.3 as best as I can tell.)
I've found the opensource code for Apple's posix_spawn() scattered across it's Libc and xnu source in Leopard. Which makes it sound like it's integrated into the kernel. Still, it sounds like if we could somehow find and port over a c library (like FreeBSD's or something,) we could possibly get posix_spawn() in Tiger.

Note that this is just all positive speculation from me as I am trying to comprehend things that are out my league. :p

@CHC: Will do, Tiger is all I have. ;)

Update: Well I'm currently posting from TFF5 on my PowerBook G4. It indeed feels snappier than 4.0.1 (I had b1 on it.) The first time I tried to quit TFF5 it was taking forever so I force quit it. But it's working fine now. I'm not experiencing the widget bug that's on Leopard, but the bookmark menu does seem to be unusually wide. Although it's completely functional for me.

I'll try to test TFF5 on my Lombard and Sawtooth over the weekend if I have the time. ;)

Sunspider results: 7736.9ms

Not as fast as a G5, but at least it ran the test. 4.0.1b1 wouldn't even run it for me. :p

mp.ls