hyln9 / ikarus

Optimizing incremental native-code compiler for R6RS scheme. This is a forked repository.
https://launchpad.net/ikarus
Other
5 stars 0 forks source link

Request: export fork #225

Closed hyln9 closed 10 years ago

hyln9 commented 10 years ago

I'd like to use it so I can make a server socket, fork a number of workers, and have them accept on it (easy multi-processor utilization and copy-on-write ikarus address spaces! :-). I've already been doing this with my patched ikarus. I think I'll post an example on ikarus-users once I've made it and fork is exported.

Launchpad Details: #LP237608 Derick Eddington - 2008-06-05 08:13:12 -0400

hyln9 commented 10 years ago

Exported in 1500. I did preliminary timing of how fast fork is and it turns out to be about 20ms real time (you can do only 50 a second) on my macbook.

Launchpad Details: #LPC Abdulaziz Ghuloum - 2008-06-06 10:55:41 -0400

hyln9 commented 10 years ago

(define (f n) (unless (zero? n) (fork waitpid exit) (f (- n 1)))) (time (f 100)) running stats for (f 100): no collections 24 ms elapsed cpu time, including 0 ms collecting 1992 ms elapsed real time, including 0 ms collecting 0 bytes allocated

Launchpad Details: #LPC Abdulaziz Ghuloum - 2008-06-06 10:57:10 -0400

hyln9 commented 10 years ago

Yeah, I wouldn't use it repeatedly when super speed matters. I like it because you can fork as many workers as you have CPUs, and they can all accept from the same server socket which was created before the forking, and then use Ikarus's multiplexing non-blocking I/O system to have each worker handle multiple clients simultaneously. I'm still investigating if I've found a unicode transcoding bug and haven't gotten to timing it yet but it's looking fast :)

Launchpad Details: #LPC Derick Eddington - 2008-06-06 13:13:35 -0400

hyln9 commented 10 years ago

Linux seems to be a lot faster, and I know my laptop is slower than yours. (I think the 1600 bytes mine allocated is from the new waitpid.)

(define (f n) (unless (zero? n) (fork waitpid exit) (f (- n 1)))) (time (f 100)) running stats for (f 100): no collections 20 ms elapsed cpu time, including 0 ms collecting 524 ms elapsed real time, including 0 ms collecting 1600 bytes allocated

Launchpad Details: #LPC Derick Eddington - 2008-06-13 11:46:34 -0400

hyln9 commented 10 years ago

fork is painfully slow on Windows, just see how ./configure takes to run on Cygwin :(

Launchpad Details: #LPC leppie - 2008-06-13 12:40:12 -0400

hyln9 commented 10 years ago

On Jun 13, 2008, at 9:40 AM, leppie wrote:

fork is painfully slow on Windows, just see how ./configure takes
to run on Cygwin :(

Since you already have a launchpad account, you might as well order
your free Ubuntu CD now*, ... :-)

Launchpad Details: #LPC Abdulaziz Ghuloum - 2008-06-14 00:40:02 -0400

hyln9 commented 10 years ago

Thanks, but I got that :)

I used to have an install, till my WD Raptor hard disk failed :(

Anyways, who else will check the Cygwin builds? :)

Launchpad Details: #LPC leppie - 2008-06-14 03:00:20 -0400