public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Hilda Klasky" <hklasky@mcdc.panasonic.com>
To: <gcc-help@gcc.gnu.org>
Subject: program 'hangs' when running several instances of program for writing to a file...
Date: Mon, 16 Jun 2003 18:53:00 -0000	[thread overview]
Message-ID: <CDEDLEPHMNNOCNPKBLPGAEOECPAA.hklasky@mcdc.panasonic.com> (raw)

Hi Everyone, I hope some one could help me please.

I am using:

Red Hat 9.0
Kernel 2.4.20-8
gcc 3.2.2

My program writes to a file 25K of data every 25 milliseconds. It optionally
flushes the buffer as specified by the user on the entry parameters.

The problem I have is that, when I attempt to run two instances of the
program, (each one writes to a different file); one of the process 'hangs'
(stops writing to the file), when I select the flush option to be on.

When I select the flush option to be off, and I run more than 2 instances of
the program, one of the process 'hangs' also.

I wonder if some how I am over loading some buffer.
I will appreciate your help. Thank you very much in advance.

The core of my code follows:

for (i=0;i<4000;i++){
         //get the time
         t1=microseconds();
         //write the block of data
         of.write(buffer, (unsigned int) read_size);

         if (flush){
             of.flush();
         }//flush

         //get the time again
         t2=microseconds();

         //sleep time:
         long int sleept = floor( ((t1+d)-t2)*1000);
         usleep( sleept );
         //end of sleep time

      }//for i=1 to ..


             reply	other threads:[~2003-06-16 18:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-16 18:53 Hilda Klasky [this message]
2003-06-18 17:17 ` Claudio Bley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CDEDLEPHMNNOCNPKBLPGAEOECPAA.hklasky@mcdc.panasonic.com \
    --to=hklasky@mcdc.panasonic.com \
    --cc=gcc-help@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).