Skip to content

Spawning Posix compatible system process and Dispatching tasks to multiple VMs

License

Notifications You must be signed in to change notification settings

lxsang/SystemProcess

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SystemProcess

  • Spawning Posix compatible system process using posix_spawn
  • Dispatching code to multiple VMs, each VM runs on a separated system process. Inter-processes communication via shared memory

Install

Metacello new
	repository: 'github://lxsang/SystemProcess';
	baseline:'SystemProcess';
	load

Process spawn Example

Execute a command and redirect its stdout

|o|
o:= SystemProcess new.
o redirectStdout.
o onOutputDo: [
	:d| Transcript show: d
].
o onFinishDo: [ o cleanup ].
o shellCommand: { 'ls'. '-al' }.

Execute a command and redirect its stdin, stdout:

|o crlf|
crlf := Character cr asString, Character lf asString.
o:= SystemProcess new.
o redirectStdout.
o redirectStdin.
o onOutputDo: [
	:d| Transcript show: d
].
o onFinishDo: [ o cleanup ].
o shellCommand: { '/bin/sh'}.
o stdinStream nextPutAll: 'ls -al', crlf.
"exit /bin/sh"
o stdinStream nextPutAll: 'exit',crlf

InterVM example

Please refer to this post: https://blog.lxsang.me/post/id/25

About

Spawning Posix compatible system process and Dispatching tasks to multiple VMs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published