Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the memory overhead for a single windows threads?

Is it 1 Mb of stack per thread? Or is that just CLR threads?

I want to know the memory over head of native windows threads (c++) and CLR threads as view via Task Manager.

Thanks

like image 363
DayOne Avatar asked Apr 30 '10 12:04

DayOne


People also ask

What is thread overhead?

Essentially, the overhead is like the serial portion in Amdahl's law. So if the overhead is 1000 ns and the work, single threaded is 3000 ns, you use a serial fraction of 0.25. Really, the overhead is not serial, but rather parallel but proportional to the number of threads but that works out to almost the same thing.

How many threads can I run on Windows?

On Windows machines, there's no limit specified for threads. Thus, we can create as many threads as we want, until our system runs out of available system memory.

Which memory do threads share?

We talked about the two types of memory available to a process or a thread, the stack and the heap. It is important to distinguish between these two types of process memory because each thread will have its own stack, but all the threads in a process will share the heap.

What is thread in windows?

A thread is the basic unit to which the operating system allocates processor time. A thread can execute any part of the process code, including parts currently being executed by another thread. A job object allows groups of processes to be managed as a unit.


1 Answers

The default is 1 MB for both native and CLR threads. You can alter it, though that's usually a bad idea.

like image 124
Marcelo Cantos Avatar answered Sep 29 '22 07:09

Marcelo Cantos