Questions tagged [fibers]

A fiber is a lightweight thread which uses cooperative rather than preemptive multitasking. It is very similar to and often confused with a [coroutine]. Use this tag for questions relating to the [ruby] feature, otherwise prefer to use [coroutine].

A fiber is a lightweight thread which uses cooperative rather than preemptive multitasking. It is very similar to and often confused with a .

In Ruby, fibers are primitives for implementing light weight cooperative concurrency. It appeared in Ruby 1.9.

Related tags

189 questions
7
votes
1 answer

Waiting for async calls with EventMachine and Ruby fibers

I'm running this code snippet under Ruby 1.9.2: require "eventmachine" require "fiber" EM.run do fiber = Fiber.new do current_fiber = Fiber.current EM.add_timer(2) do print "B" current_fiber.resume("D") end …
breaker
  • 73
  • 1
  • 5
6
votes
0 answers

Ruby Async Gem: What is a basic usage example?

With Ruby 3.0 the async gem is now compatible with blocking IO in standard library functions and I wanted to understand the basic functionality but am already confused by a simple example: require 'async' n = 10 n.times do |i| Async do …
Christopher Oezbek
  • 23,994
  • 6
  • 61
  • 85
6
votes
1 answer

Does a blocking IO in Quasar's fiber block a thread in its threadpool?

As far as I know, in Akka, all actors are scheduled over a pool of threads. Too many actors perform blocking IO simultaneously, each blocking call blocks one thread, results in a thread outage. Now I'm looking at an interesting fiber implementation…
cfchou
  • 1,239
  • 1
  • 11
  • 25
6
votes
4 answers

Client Side Implementation of Fibers in JavaScript.

AFAIK meteorjs uses node-fibers, but their github page states that it is server side & v8 only (or is it not ?). How does meteorjs implement nonblocking, synchronous like api on the client side? Is it compatible with other browsers than chrome? I…
g00fy
  • 4,717
  • 1
  • 30
  • 46
5
votes
0 answers

Why in Ruby 1.9 Continuations are evil?

I am relative new in Ruby world. And I don't know, what to think. In 'The Ruby Programming Language' I read I shouldn't use Continuations in new code and use Fibers instead. I found this presentation (from 2008)…
guest
  • 1,696
  • 4
  • 20
  • 31
5
votes
2 answers

How do I get the querystring using Golang's Fiber?

My code app.Get("/event/*", func(c *fiber.Ctx) error { // GET THE ACCOUNT FROM THE PATH fmt.Println("PATH") fmt.Println(c.Path()) fmt.Println("END PATH") …
Eric Crook
  • 63
  • 1
  • 1
  • 3
5
votes
2 answers

Ruby fiber: resuming transferred fibers

I am trying to understand the behavior of the following code snippet. My specific focus is on the Fiber#transfer method. require 'fiber' fiber2 = nil fiber1 = Fiber.new do puts "In Fiber 1" # 3 fiber2.transfer …
CppNoob
  • 2,322
  • 1
  • 24
  • 35
5
votes
1 answer

Fiber Local vs Thread Local Variable

I am very confused on when to use fiber local variables over thread local variables in rails. My use case is following: I have a controller in rails which on a GET request does some computation and stores the result (which is a list of integers) in…
snow_leopard
  • 1,466
  • 2
  • 20
  • 36
5
votes
1 answer

How fibers can exist in Java

I know that my question is more academic than a real issue. In most cases a thread implementation with Fiber-like logic would be OK. But is there any way to implement Fibers as they are described in the JVM? Is there any framework that is missing me…
Evan P
  • 1,767
  • 1
  • 20
  • 37
4
votes
1 answer

Difference between Reactor Flux and Java Fiber

I've been reading about Java Fibers as small unit of work which would mapped to Threads. In case of a blocking call a different Fiber would be mapped to the same Thread. Since Threads in Java are kernel level threads, this would prevent Threads from…
Apurv
  • 315
  • 5
  • 14
4
votes
2 answers

/node_modules/fibers/bin/linux-x64-v8-7.6/fibers.node` is missing. Try reinstalling `node-fibers`?

I have an issue with starting my meteor bundle created with demeteorizer. When I am trying to start bundle I have error shown below. NodeV: 0.10.40, fibersV: 1.0.1 I tried to npm uninstall fibers and npm install them again. This is my…
4
votes
1 answer

Nokogiri vs Goliath...or, can they get along?

I have a project that needs to parse literally hundreds of thousands of HTML and XML documents. I thought this would be a perfect opportunity to learn Ruby fibers and the new Goliath framework. But obviously, Goliath falls flat if you use blocking…
cbmeeks
  • 11,248
  • 22
  • 85
  • 136
4
votes
2 answers

npm ERR! fibers@1.0.15 install: `node build.js || nodejs build.js`

I'm trying to install Sunbird on my laptop by referring document. But getting error on npm install step gyp WARN install got an error, rolling back install gyp ERR! configure error gyp ERR! stack Error: unexpected end of file gyp ERR! stack at…
Amol Ghatol
  • 179
  • 3
  • 8
4
votes
0 answers

Cant find modules 'fibers' in Meteor in Windows OS

I tried to use Future by using var Future = require('fibers/future'). I installed fibers using meteor npm install --save fibers, meteor npm install fibers, npm install -g fibers, meteor npm install --save node-gyp, and npm install -g node-gyp`. I…
JMA
  • 974
  • 3
  • 13
  • 41
4
votes
3 answers

How to use boost context correctly

I want to implement a job system for my game engine using fibers. After searching the internet for a good c++ implementation of fibers, I found that Boost.Context is a good starting point. Update 1: I want to implement my own scheduling algorithm,…
DontCareBear
  • 825
  • 2
  • 11
  • 25
1
2
3
12 13