ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Good time of day!
The problem is the following:
System: Intel, Linux RedHat 7.2, Kernel 2.4.19, gcc-3.3.
The program works as a server.
When new request comes, it creates a pthread.
There can not be created 2 threads at the same time,
in this case we just do not create new thread.
Every called thread completes and exits, allowing next thread to be called.
After a number of such calls (200,000 on my system) operational system does not
allows to create a new thread et all, in any case returning EAGAIN error,
so the system stops to work.
In case i just create one infinite thread, wich makes corresponding tasks,
and starting it using flags, this problem is never arrise.
Could you please, explain me a possible source of this error,
Thank you, looks like it works fine, but if you put this code before pthread_create,
in other case it will stop the main program when pthread works
But why this error arrise, is 0.1 second is not enough for finishing pthread?
Thanks a lot,
Actually, by adding pthread_join(processor, NULL); you make sure that the main program waits for the child thread to terminate. So, it's like
1.main threads creates child thread
2.main thread waits for the child thread to terminate.(due to pthread_join)
3.when the child thread terminates, all the resources used my the child thread is freed.
4. go back to step 1.