LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-12-2009, 01:01 AM   #1
naveenisback
Member
 
Registered: Jun 2009
Posts: 80
Blog Entries: 1

Rep: Reputation: 16
how to use sysctl to avoid I/o error


Hi

language:c
OS:redflag


In my multithread server-client program I have to run more than 1000 threads. But when I try to run more than 300 threads following errors are occured.

I/O error : Too many open files
I/O warning : failed to load external entity /home/naveen/TEST/sysinfo.txt"

In my program each and every thread has to read sysinfo.txt file.

how to get rid from this.

can we use 'sysctl'? how can we use this command.

I have changed file-max from 104176 to 214176.. I have rebooted.. but still I am getting same error..


pls help me!!!!

thanks in advance..

Last edited by naveenisback; 08-12-2009 at 03:11 AM.
 
Old 08-12-2009, 11:11 PM   #2
hpsmouse
LQ Newbie
 
Registered: Aug 2009
Location: China
Distribution: ubuntu
Posts: 11

Rep: Reputation: 2
Now that you use threads instead of processes, why don't you just open the file once? You can share the file descriptor between threads and use locks to control the access.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Error: /sbin/sysctl : no such file or directory jujin Linux - Kernel 1 07-09-2009 06:19 AM
How to avoid this CD Write error? vibinlakshman Linux - Software 1 03-07-2009 01:17 PM
SYSCTL errors on net.ipv4.route.flush with unknown error 1 Electro Linux - Networking 1 08-01-2005 12:48 AM
mysql dupe entry error, how to avoid? hydro Linux - Software 0 09-20-2003 12:08 PM
sysctl permissions error on key vm.freepages DavidPhillips Linux - General 2 06-16-2001 10:48 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:43 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration