Paste: parallel-map corruption

Author: erg
Mode: factor
Date: Thu, 9 Mar 2023 17:21:03
Plain Text |
USING: accessors arrays command-line io io.encodings.binary
io.servers kernel math.parser namespaces prettyprint random
ranges sequences strings ;
IN: string-server

: serve-string ( -- )
    10,000,000 100,000,000 over <range> random
    CHAR: a CHAR: z [a..b] random [ 2dup 2array . flush ] with-global
    <string> write flush ;

: <string-server> ( port -- server )
    utf8 <threaded-server>
        swap >>insecure
        "string.server" >>name
        [ serve-string ] >>handler ;

: string-server-main ( -- )
    command-line get [ 1239 ] [ first string>number ] if-empty
    <string-server> start-server wait-for-server ;

MAIN: string-server-main



! 100 <iota> >array [ drop "127.0.0.1" 1239 <inet4> binary [ read-contents [ all-eq? ] [ length ] bi 2array ] with-client ] parallel-map

Annotation: .95 test

Author: erg
Mode: factor
Date: Sat, 29 Apr 2023 21:56:10
Plain Text |
USE: io.servers

: serve-string ( -- )
    10,000,000 100,000,000 over <range> random
    CHAR: a CHAR: z [a,b) random [ 2dup 2array . flush ] with-global
    <string> write flush ;

: <string-server> ( port -- server )
    utf8 <threaded-server>
        swap >>insecure
        "string.server" >>name
        [ serve-string ] >>handler ;

: string-server-main ( -- )
    command-line get [ 1239 ] [ first string>number ] if-empty
    <string-server> start-server wait-for-server ;


100 iota >array [ drop "127.0.0.1" 1239 <inet4> binary [ read-contents [ all-eq? ] [ length ] bi 2array ] with-client ] parallel-map

Annotation: .95 better

Author: erg
Mode: factor
Date: Sat, 29 Apr 2023 21:59:07
Plain Text |
: serve-string ( -- )
    10,000,000 100,000,000 over <range> random
    CHAR: a CHAR: z [a,b) random [ 2dup 2array . flush ] with-global
    <string> write flush ;

: <string-server> ( port -- server )
    utf8 <threaded-server>
        swap >>insecure
        "string.server" >>name
        [ serve-string ] >>handler ;

: string-server-main ( -- )
    command-line get [ 1239 ] [ first string>number ] if-empty
    <string-server> start-server wait-for-server ;


string-server-main


100 iota >array [ drop "127.0.0.1" 1239 <inet4> binary [ contents [ all-eq? ] [ length ] bi 2array ] with-client ] parallel-map

New Annotation

Summary:
Author:
Mode:
Body: