Categorygithub.com/GiorgosMarga/simplescript
repositorypackage
0.0.0-20240612145856-84ffe644b256
Repository: https://github.com/giorgosmarga/simplescript.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# README

multiply.txt

Example: ./main run multiply.ss 5 15

sender.txt

  • Takes as arguments an integer , an integer , a string and an integer
  • Waits seconds and sends to thread the message
  • This is repeated times

receiver.txt

  • Takes as arguments an integer and an integer
  • Receives from thread a text message and prints it
  • This is repeated times

Example for 3 iterations: ./main ./main -p=":3001" -peers="127.0.0.0:3000" run sender.ss 1 3 hello 5 || receiver.ss 1 3 One process should automatically migrate to :3001

ring.txt

  • Takes as arguments three integers , , , an integer and an integer
  • Sends along a ring, according to and , a token with an initial value of 1
  • The token value is incremented after each hop
  • Forwarding is done after a delay of seconds
  • The token makes circles around the ring

Example for a ring of 3 threads and 5 iterations: go run main.go go run main.go -p=":3001" -peers="127.0.0.0:3000" run ring.ss 0 1 2 2 10 || ring.ss 1 2 0 2 10 || ring.ss 2 0 1 2 10 go run main.go -p=":3002" -peers="127.0.0.0:3000,127.0.0.0:3001" migrate 0 0 127.0.0.0 :3001

To test shutdown go run main.go run ring.ss 0 1 2 2 10 || ring.ss 1 2 0 2 10 || ring.ss 2 0 1 2 10 go run main.go -p=":3001" -peers="127.0.0.0:3000" shutdown

To test sleep go run main.go run sleep.ss || sleep.ss go run main.go -p=":3001" -peers="127.0.0.0:3000" go run main.go -p=":3002" -peers="127.0.0.0:3000,127.0.0.0:3001" migrate 10 2 127.0.0.0 :3002