1 USING: alien.syntax io io.encodings.utf16n io.encodings.utf8 io.files
2 kernel namespaces sequences system threads unix.utilities ;
5 FUNCTION: void* start_standalone_factor_in_new_thread ( int argc, char** argv ) ;
7 HOOK: native-string-encoding os ( -- encoding )
8 M: windows native-string-encoding utf16n ;
9 M: unix native-string-encoding utf8 ;
11 : start-vm-in-os-thread ( args -- threadhandle )
12 \ vm get-global prefix
13 [ length ] [ native-string-encoding strings>alien ] bi
14 start_standalone_factor_in_new_thread ;
16 : start-tetris-in-os-thread ( -- )
17 { "-run=tetris" } start-vm-in-os-thread drop ;
19 : start-testthread-in-os-thread ( -- )
20 { "-run=mttest" } start-vm-in-os-thread drop ;
23 "/tmp/hello" utf8 [ "hello!\n" write ] with-file-appender 5000000 sleep ;