Skip to content

Conversation

ioquatix
Copy link
Member

@ioquatix ioquatix commented Aug 23, 2023

Compare memory usage of threads vs fibers.

cc @MatheusRich

Contribution


pid = fork do
fibers = 100.times.map do
Fiber.new{loop{Fiber.yield}}.resume

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might have missed something, but doesn't this only run once, while the thread example sleeps forever?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the fibers and threads are still alive at the point where you measure memory usage. Does that seem sufficient?

@MatheusRich
Copy link

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants