N
N
numitus2013-02-13 22:31:53
linux
numitus, 2013-02-13 22:31:53

Linux threads how?

I create a flow

int result = pthread_create(&thread1, 0, new_connection,s);

Why does an empty stream take up 10MB of memory?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
antonyter, 2013-02-14
@numitus

Maybe under the stack?

V
vsespb, 2013-02-14
@vsespb

Maybe it's not real memory, but shared memory? Create N / 10 threads, where N is the number of megabytes of memory installed in the computer.

S
Semyon Dubina, 2013-02-14
@sam002

This is shared. It's hard to keep track of...
Experiment for - fill some global array with a lot of data and see if the memory grows under the thread.
Just in case, look at the stack size through pthread_attr_getstacksize , it may cost a minimum stack of 10 meters.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question