Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
20 user(s) are online (11 user(s) are browsing Forums)

Members: 0
Guests: 20

more...

Support us!

Headlines

 
  Register To Post  

Question about CPU time
Just popping in
Just popping in


See User information
Hi,

I have an program that is run in a shell window, it takes 90% of the CPU time (so CPUInfo reports), everything runs in a separate thread (created with pthread) i don't handle SIGBREAKF_CTRL_C in the main loop, just a loop with sleep(10) from pthread.

When i hit Ctrl+C the window reads: "***BREAK" and the CPU time suddenly drops to half the time while the threaded code still runs happily.

Question:

- Why does the program continue to run with only taking (apparently ?) half the CPU time ?

Go to top
Re: Question about CPU time
Just popping in
Just popping in


See User information
Never mind, i found out what the problem was.

Go to top
Re: Question about CPU time
Amigans Defender
Amigans Defender


See User information
@hitchhikr

Glad you could solve it! I would only have been guessing.

The Rear Window blog

AmigaOne X5000 @ 2GHz / 4GB RAM / Radeon RX 560 / ESI Juli@ / AmigaOS 4.1 Final Edition
SAM440ep-flex @ 667MHz / 1GB RAM / Radeon 9250 / AmigaOS 4.1 Final Edition
Go to top
Re: Question about CPU time
Home away from home
Home away from home


See User information
@hitchhikr

You should catch the CTRL+C, using sigaction(),
or SetSignal(), use amiga version of Printf instead of c version printf.
make sure all threads are safely stopped, before program exits.
imagine you had closed libraries while they are being used.

(NutsAboutAmiga)

Basilisk II for AmigaOS4
AmigaInputAnywhere
Excalibur
and other tools and apps.
Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project