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
1 answer

Meteor call Email send from server returns fiber error

I am trying to do something which i thought would have been very trivial, but apparently is not. I need to do something very simple, I need to run a setInterval so to check whether "today" is a new day, and if it is a new day, get some data and send…
0
votes
0 answers

Segfault when using swapcontext() in user level thread library?

I am trying to implement a user=level thread library using the setcontext/getcontext/ect... library of system calls. For the life of me I cannot figure out why I am getting a segfault when I try to swap contexts in my waitall and yield functions…
0
votes
1 answer

JSON will not insert into Meteor Collection (even with Fiber or bindEnvironment)

I realize that similar topics have been discussed, I have browsed through them all and tried to mimic solutions for about 4 hours but none of them seem to solve the problem. I would not have posted this with having exhausted any potential solution I…
sam_c
  • 810
  • 7
  • 25
0
votes
1 answer

Auto-Switch-Context between a list of fibers

Is there a way to implement system like OS that allocates time for each process\thread with fibers? I mean like when I run a process and do an infinite loop inside it, the OS can still function normal on one core. (It switch context automatically…
KugBuBu
  • 630
  • 5
  • 21
0
votes
0 answers

Ruby: Event Machine Tweetstream and Fibers

Im have trying to play around with the tweetstream gem to access the twitter's streaming api to fetch tweets and save the tweets in the database. I have been trying to use eventmachine along with Ruby fibers for the first time to speed up the tweet…
Raghu
  • 2,543
  • 1
  • 19
  • 24
0
votes
2 answers

Coroutine: How to tell if a windows fiber has finished execution?

I have the following function that I use as an entry point for a windows fiber. void foo(void*) { for(int i =0; i < 10; ++i) { doStuff(); } } Now I call SwitchToFiber in my main in a for loop; something like the following. int main() { ...…
Jimmy Lu
  • 4,810
  • 7
  • 25
  • 30
0
votes
2 answers

Why my eventmachine client code doesn't work asynchronously?

def index p "INDEX, #{Fiber.current.object_id}" # <- #1 EventMachine.run { http = EventMachine::HttpRequest.new('http://google.com/').get :query => {'keyname' => 'value'} http.errback { p "Uh oh, #{Fiber.current.object_id}"; EM.stop } #…
Benjamin
  • 10,085
  • 19
  • 80
  • 130
-1
votes
1 answer

c++ boost:fiber - How can i interrupt a fiber or join waiting until a maximum time?

How can i stop(interrupt) a fiber using c++ boost? for example fiber.stop() How can i execute fiber join(time) using c+ boost(the default api dont accept a maximun time for waiting) ? for example: fiber.join(1000); it is possible to suspend a…
1 2 3 4 5 6
7