Questions tagged [fiber]

Fibers are particularly lightweight threads of execution which use co-operative multitasking.

In computer science, a fiber is a particularly lightweight thread of execution..

Like threads, fibers share address space. However, fibers use co-operative multitasking while threads use pre-emptive multitasking. Threads often depend on the kernel's thread scheduler to preempt a busy thread and resume another thread; fibers yield themselves to run another fiber while executing. The article on threads contains more on the distinction between threads and fibers.

Fibers can be considered as implementation of coroutines so you might like to check also [coroutine] tag.

98 questions
0
votes
0 answers

How can I make an HTTP request within a fiber without a context switch?

While running the following (simplified) code in meteor, I encountered an unexpected behaviour: import { HTTP } from 'meteor/http'; Fiber = Npm.require('fibers'); let x = {}; Fiber(function() { x.a = 1; let result =…
Yarin
  • 141
  • 6
0
votes
1 answer

i got 'boost::fibers::lock_error' and can't figure out why

i run this code class ttt { public: ~ttt() { LOG(INFO); flush(); } bool flush() { //std::lock_guard lock(_mutex); LOG(INFO); _mutex.lock(); LOG(INFO); auto…
beegerous
  • 11
  • 2
0
votes
1 answer

how to build boost fiber library for segmented stack support

I am trying to build boost fiber library , I am not sure on what command line arguments to pass to the ./b2. ./b2 --reconfigure cxxflags="-std=c++14" threading=multi variant=release link=shared --toolset=gcc segmented-stacks=on Performing…
Ravikumar Tulugu
  • 1,702
  • 2
  • 18
  • 40
0
votes
0 answers

Sailsjs fiber integration

Im trying to integrate SailsJS with synchronize, which is based on fibers. http://alexeypetrushin.github.io/synchronize/docs/index.html As commented on other fiber libraries, I added a custom middleware to create a new fiber per the request. var…
kivind
  • 1
  • 1
0
votes
1 answer

Meteor Fiber issue with callback in knox

I'm having difficulty understanding where exactly I should implement wrapAsync/bindEnvironment in the code I'm working on. I am making a call to a url with http/knox and uploading it to my S3 bucket which works, but when I try to call the function…
Jtanacredi
  • 53
  • 6
0
votes
1 answer

Can a thread run another fiber when the running fiber is in blocked

As far as I see,a thread can run another fiber when the running fiber is in blocked.But it is not the case.I create 100 fibers which will search solr.The result I find is all the fibers is executed in order.Another fiber can execute only if the…
0
votes
1 answer

Can I dispatch Fibers over a threadPool in D

What I want is to gain the Fiber's high efficiency on context switching and yield CPU time during I/O, but when the workload is enough to feed more CPUs I would like to gain the performance from the fact of do things in parallel. I read this great…
0
votes
1 answer

Why is meteor no longer working? `throw new Error('`'+ modPath+ '.node` is missing. Try reinstalling `node-fibe`

I'm running Meteor 1.3.2.4 and Node v4.4.3 . All my projects no longer load and show the following error. At first it was a Cannot find modules fibers error for which I did meteor build --directory ../build and cd…
Squirrl
  • 4,909
  • 9
  • 47
  • 85
0
votes
2 answers

Quasar SuspendExecution

I have a Class named Foo which calls a non-static method barMethod() of Bar. Barextends Fiber. Inside barMethod() there is a call to park(). Now which Fiber will be parked? Foo instance or Bar instance? Signature of park() (It is defined static and…
Alireza Mohamadi
  • 751
  • 1
  • 6
  • 22
0
votes
0 answers

Constructing an object in a static function within a dll creates run time hang

//main Scheduler::start(0, 2, emptyTask, true, false); This is the head file for a function with a static function called start() //scheduler.h namespace fbr{ static FiberPool *fiberPool; ... …
Geff
  • 52
  • 1
  • 5
0
votes
1 answer

How do I get quasar fibers working optimally with JSF?

How do I get quasar working optimally with JSF? I created a JSF project with Comsat Quasar integration on the lines of FiberHttpServlet but do not see any improvement in numbers. My project is here :…
Sacky San
  • 1,535
  • 21
  • 26
0
votes
1 answer

Passing Messages Between Fibers Quasar

I am using a quasar fiber to listen to and process messages on a QueueObjectChannel. I am not sure what Object I am supposed to use as the message queue between fibers. The problem I am having is I don't understand what is supposed to be passed into…
ford prefect
  • 7,096
  • 11
  • 56
  • 83
0
votes
1 answer

Stop a Twisted Fiber Mid-Execution

There are many ways to create a Python Twisted fiber. For example, one could call reactor.callWhenRunning(helloWorld). helloWorld() will execute and the fiber will stop executing when helloWorld() returns. What if half way through executing…
Nathan
  • 8,093
  • 8
  • 50
  • 76
0
votes
0 answers

In reference to fibers, what is user space?

When people explain the difference between threads and fibers, they often refer to the fact that fibers are in "user space". What does "user space" mean?
Jacob Zimmerman
  • 1,521
  • 11
  • 20
0
votes
1 answer

Mongodb colelction find in cron job throws new Error('Can\'t wait without a fiber');

I have set up a cron job using the npm package cron. I am trying to do the following Coll.find().forEach function but I am getting the error Error: Can't wait without a fiber var job = new CronJob({ cronTime: '00 09 11 * * 1-5', …
meteorBuzz
  • 3,110
  • 5
  • 33
  • 60