- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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, and just left with pthread_create, the problem disappeared. I also have a smaller project that uses the same makefile, and the threads are created fine. I set my stack size to be FLTFLAGS := -s 2000000 ...I'm not sure what the problem is. Anyone has a suggestion? ThanksLink Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Also, to note: if the project doesn't call pthread_create(), the project runs fine. I wanted to use thread to handle external events (interrupts, DMA in the background, etc)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Forgot to mention that my environment is uCLinux on Nios-II processor.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Problem 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().
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page