Forum Discussion
Altera_Forum
Honored Contributor
20 years agoApplication freezes using Posix thread
I have a medium-sized project that creates threads. Really weird problem is, after the pthread_create(), the console freezes. I dont know what the problem is. I tried commenting everything out,...
Altera_Forum
Honored Contributor
20 years agoProblem solved. The reason was because I allocated too many big local variables. Each of those local variables was a data structure. All of them add up to be about 7331 bytes. I fixed this problem by using malloc() to create those variables instead.
At first, my program's size was about 4000K when I did a "ps" command, but now it dropped down to 2000K. so, it's all good now. No more hangups when I call pthread_create().