Created
April 27, 2019 06:21
-
-
Save ledsun/f84a3bcb7b4e8938acdac0c02b282a30 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
t = Thread.new { | |
p 'hi thread' | |
sleep 3 | |
p 'bye thread' | |
} | |
fork do | |
p 'hi process' | |
t.join | |
p 'bye process' | |
end | |
t.join | |
p 'main' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment