answersLogoWhite

0


Best Answer

9

In the most simple terms, threads are generally considered to be preemptive (although this may not always be true, depending on the operating system) while fibers are considered to be light-weight, cooperative threads. Both are separate execution paths for your application.

With threads: the current execution path may be interrupted or preempted at any time (note: this statement is a generalization and may not always hold true depending on OS/threading package/etc.). This means that for threads, data integrity is a big issue because one thread may be stopped in the middle of updating a chunk of data, leaving the integrity of the data in a bad or incomplete state. This also means that the operating system can take advantage of multiple CPUs and CPU cores by running more than one thread at the same time and leaving it up to the developer to guard data access.

With fibers: the current execution path is only interrupted when the fiber yields execution (same note as above). This means that fibers always start and stop in well-defined places, so data integrity is much less of an issue. Also, because fibers are often managed in the user space, expensive context switches and CPU state changes need not be made, making changing from one fiber to the next extremely efficient. On the other hand, since no two fibers can run at exactly the same time, just using fibers alone will not take advantage of multiple CPUs or multiple CPU cores.

Source

http://stackoverflow.com/questions/796217/what-is-the-difference-between-a-thread-and-a-fiber

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the difference between thread and fiber?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is difference between plastics and fiber?

The difference between plastics and fibers is how they are made. Plastic is made by melting particles together. Fiber is made by weaving materials together like cotton thread. Plastic is nonporous and fiber is porous.


What is the difference between thread and virus?

A virus runs in a thread, as do all programs. The difference between a generic thread and a virus is that the thread may not be harmful, while the virus generally is.


Difference between monofilament fiber and multifilament fiber?

monofilament


What is the difference between a thread and post?

In computing terms - A 'thread' is a topic of discussion, and a 'post' is a response to the 'thread'.


What is the difference between thread rope and string?

The difference between thread rope and string is that thread is more thicker than string and that string is more thinner than rope and thread is more thinner than rope there's your answer geese


What is the difference between fiber and fiber?

The only difference is the spelling. In UK, Australia, New Zealand, etc., it is spelt, "fibre". In USA, it is spelled, "fiber".


Is thread as used by Intel in their marketing for Hyper-Threading Technology same as the thread that is talked about when discussing the difference between a process and a thread?

No.


What is the difference between rope and string?

The difference between thread rope and string is that thread is more thicker than string and that string is more thinner than rope and thread is more thinner than rope there's your answer geese


What is the difference between the contour and magnitude of single nerve fiber and nerve trunk?

What is the difference between the contour and magnitude of single nerve fiber and nerve trunk?


What is the difference between fiber optics and optical fiber?

Fiber and fibre mean the same thing. The only difference is that fiber is derived from American English, and fibre is derived from European English.


What Is The Difference Between fiber And Polyester?

dun noe


What is the difference between suspending stopping a thread?

Stop threading terminates the thread and cannot be resumed whereas suspend puts thread to sleep indefinitely and it can be resumed.