Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2001-09

Additional... Pseudo-Thread

4 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Jens Rosenthal
Show quoted text 19 lines
Hi Everyone, hope you can help me with my question... I'd like to have several instances of my program running at the same time, working apart from one another. The problem is, every instance takes 99.8 % CPU time, so only the first instance is running, then the second, and so on. In Java I would define the program as thread and let the thread sleep at certain points in execution, so that the other instances can take their time. any ideas how I could handle this behavior with fpc? many thanx in advance, Jens

Sorry for forgetting an important part.

I'm trying this on linux.

Brad Campbell
to Jens Rosenthal
Jens Rosenthal wrote 5 lines
Sorry for forgetting an important part. I'm trying this on linux.

Yeesh.. what are you doing to consume so much CPU?

Brad.... /"\ Save the Forests \ / ASCII RIBBON CAMPAIGN Burn a Greenie. X AGAINST HTML MAIL / \
Adam Naumowicz
to Jens Rosenthal: Sorry for forgetting an important part. I'm trying this on linux.
Jens Rosenthal wrote 23 lines
> Hi Everyone, > > hope you can help me with my question... > > > I'd like to have several instances of my program running at the > same time, working apart from one another. > > The problem is, every instance takes 99.8 % CPU time, so only the > first instance is running, then the second, and so on. > In Java I would define the program as thread and let the thread > sleep at certain points in execution, so that the other instances > can take their time. > > any ideas how I could handle this behavior with fpc? > > many thanx in advance, > > Jens Sorry for forgetting an important part. I'm trying this on linux.

Under Linux you can decrease the nice number for your apps to run together.

Regards,
Adam Naumowicz

--------------------------------------
WWW: http://math.uwb.edu.pl/~adamn/
--------------------------------------

Kuba Ober
to Jens Rosenthal: Sorry for forgetting an important part. I'm trying this on linux.
Show quoted text 5 lines
> The problem is, every instance takes 99.8 % CPU time, so only the > first instance is running, then the second, and so on. > In Java I would define the program as thread and let the thread > sleep at certain points in execution, so that the other instances > can take their time.

Every instance won't take that much time when the others run. They will take 99.8% collectively ;-).
Just try it (no, you didn't AFAICT).
Cheers,
Kuba