Questions tagged [green-threads]

Green threads are threads that are scheduled by a virtual machine (VM) instead of natively by the underlying operating system. They emulate multithreaded environments in user space without relying on any native OS capabilities.

In computer programming, green threads are threads that are scheduled by a virtual machine (VM) instead of natively by the underlying operating system. Green threads emulate multithreaded environments without relying on any native OS capabilities, and they are managed in user space instead of kernel space, enabling them to work in environments that do not have native thread support.

See also the Wikipedia article.

Related tags

59 questions
1
vote
1 answer

Prevent greenthread switch in eventlet

I have a Django/Tastypie app where I've monkey patched everything with eventlet. I analysed performance during load tests while using both sync and eventlet worker clasees for gunicorn. I tested against sync workers to eliminate the effects of…
Seán Hayes
  • 4,060
  • 4
  • 33
  • 48
1
vote
1 answer

Preemtive Multitasking in Userspace

I'm trying to implement green threads/processes in assembly. For example, I got this x64 assembly code (nasm syntax) with two loops. It outputs a lot of 'a's, but I want it to output 'a's and 'b's. This is of course not a real example, as just…
Lennart
  • 345
  • 4
  • 17
1
vote
1 answer

How to design my python application to work in parallel across multi-cores

As far as I know, in Python, if you used normal threading in a multi-core environment, GIL normally gets on the way and affects the performance in a negative way(because threads would be trying to acquire and release GIL constantly and doing a lot…
Shengjie
  • 12,336
  • 29
  • 98
  • 139
1
vote
1 answer

Java green threads using UNIX ucontext library via JNI. Is it possible?

I'm developing a simple, educational example of green (cooperative) quantum-based threads using ucontext. But I'm facing problems. The example provided below is very easy to follow amd I'll thank any help you can provide me…
francesc
  • 343
  • 3
  • 12
0
votes
1 answer

Python Postgres Connections with Green Threads

I am using psycopg2 and I have more than one green thread in my application. Each thread gets connections using psycopg2.connect. Sometimes I get the following error: error: Second simultaneous read on fileno 14 detected. Unless you really know…
0
votes
0 answers

Kernel thread and user thread and their mechanism

I having confusion with understanding kernel thread, user thread, thread model due to 'kernel mode', 'user mode', 'User threads and Kernel threads are exactly the same.'. Can anyone clarify this? Kernel thread A kernel thread is a "lightweight"…
0
votes
1 answer

How Kotlin coroutines will use Project Loom?

Right now, Kotlin coroutines are implemented without help of JVM. It does not use something like green (virtual) threads. You can read about implementation of coroutines here -…
Max
  • 1,803
  • 3
  • 25
  • 39
0
votes
2 answers

Does LoadRunner use native or green vuser threads?

I set up 100 virtual users for a Windows version of LoadRunner, with the 'Run vuser as a thread' option enabled. I then used Process Explorer on wlrun.exe (the LoadRunner Controller process) to see if the Threads metric for this process increased…
Harry
  • 3,684
  • 6
  • 39
  • 48
0
votes
1 answer

Is gevent pool wait_available thread safe

So I have a function lets say test and gevent pool of size 10. pool.Pool(size=10) def test(): pool.wait_available(timeout=0.5) pool.spawn(something) If the function test is called by different threads, will it cause any issue. I mean…
rajan sthapit
  • 4,194
  • 10
  • 42
  • 66
0
votes
1 answer

Downside of green threads: host kernel thread blocks

I am currently studying operating system and I have difficulties understanding some parts about Implementing Multi-Threaded Processes. To be specific, the textbook explains that we can implement user-level threads by the system called Per-Processor…
0
votes
1 answer

Phusion Passenger process pool explained

I am trying to understand exactly how requests to a rails application get processed with Phusion Passenger. I have read through the Passenger docs (found here:…
louism2
  • 350
  • 4
  • 18
0
votes
1 answer

How to convert synchronous blocking shared memory model code to asynchronous coroutines running on thread pool?

While there are lots of solutions matching my question partially, I'd like to know if a complete match exists. It's hard to find a complete solution because of these partial ones occupying search results. This should be a runtime framework and…
OCTAGRAM
  • 618
  • 6
  • 12
-1
votes
1 answer

What data are shared between the green thread and the kernel level thread it is bound to?

I understand that the user level threads or green threads are managed by some user-level threading library and have to be "linked" to some operating system thread to perform its task. I understand that threads are just an abstraction for a sequence…
-1
votes
2 answers

Calling multiple web-services - Node.js vs green threads

My webserver has to make calls to 3-4 web services. I was going to implement it in Node.js, but was considering gevent since I'm not a huge fan of callback code. I understand that green threads are similar in behavior to OS threads, and each thread…
tldr
  • 11,924
  • 15
  • 75
  • 120
1 2 3
4