Request: export fork

Bug #237608 reported by Derick Eddington
4
Affects Status Importance Assigned to Milestone
Ikarus Scheme
Fix Committed
Wishlist
Abdulaziz Ghuloum

Bug Description

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.

Revision history for this message
Abdulaziz Ghuloum (aghuloum) wrote :

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.

Changed in ikarus:
assignee: nobody → aghuloum
importance: Undecided → Wishlist
status: New → Fix Committed
Revision history for this message
Abdulaziz Ghuloum (aghuloum) wrote :

> (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

Revision history for this message
Derick Eddington (derick-eddington) wrote :

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 :)

Revision history for this message
Derick Eddington (derick-eddington) wrote :

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

Revision history for this message
leppie (leppie) wrote :

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

Revision history for this message
Abdulaziz Ghuloum (aghuloum) wrote : Re: [Bug 237608] Re: Request: export fork

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*, ... :-)

* https://shipit.ubuntu.com/

Revision history for this message
leppie (leppie) wrote :

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? :)

Changed in ikarus:
milestone: none → 0.0.4
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.