• Join/Login
  • Business Software
  • Open Source Software
  • For Vendors
  • Blog
  • About
  • More
    • Articles
    • Create
    • SourceForge Podcast
    • Site Documentation
    • Subscribe to our Newsletter
    • Support Request
SourceForge logo
For Vendors Help Create Join Login
SourceForge logo
Business Software
Open Source Software
SourceForge Podcast
Resources
  • Articles
  • Case Studies
  • Blog
Menu
  • Help
  • Create
  • Join
  • Login
  • Home
  • Browse
  • Scsh - a Scheme shell
  • Bugs

scsh wastes cpu time

Brought to you by: bdc, mainzelm, olin-shivers
  • Summary
  • Files
  • Reviews
  • Support
  • Tickets ▾
    • Feature Requests
    • Patches
    • Bugs
    • Support Requests
  • News
  • Code
  • Discussion
Menu ▾ ▴
  • Create Ticket
  • View Stats

Group

Searches

  • Changes
  • Closed Tickets
  • Open Tickets

Help

  • Formatting Help

#94 scsh wastes cpu time

open
nobody
run-time (53)
5
2012-07-11
2012-07-11
Tommi Höynälänmaa
No

When I run a scsh script that launches an external program the scshvm
process uses half of the available CPU time. I'm using scsh 0.6.7 on Xubuntu11.10. In order to demonstrate the bug
do the following:

1. Compile the file cprogram.c.
2. Launch the script scsh-script.scsh from a Unix shell.
3. While the script is running execute command

ps -eo comm,time,etime,%cpu

from another terminal.

The %cpu field should be a little less than 50 for both the
scsh-script and cprogram processes. By dividing time field with etime
field you see that both processes are really using half of the cpu time.

File cprogram.c:
--- cut here ---
#include <math.h>
#include <stdio.h>

#define COMPUTATION_SIZE 1000000000

int main( void )
{
double r = 0.0;
int i = 0;
for( i = 0; i < COMPUTATION_SIZE; i++ )
{
r = cos( r );
}
printf( "Result: %f\n", r );
return 0;
}
--- cut here ---

File scsh-script.scsh:
--- cut here ---
#!/usr/bin/scsh \
-e main -s
!#

(define (main args)
(run ("./cprogram")))
--- cut here ---

- Tommi Höynälänmaa

Discussion

  • Tommi Höynälänmaa

    Tommi Höynälänmaa - 2012-07-11
     
    cprogram.c
    If you would like to refer to this comment somewhere else in this project, copy and paste the following link:

Log in to post a comment.

SourceForge
  • Create a Project
  • Open Source Software
  • Business Software
  • Top Downloaded Projects
Company
  • About
  • Team
  • SourceForge Headquarters
    1320 Columbia Street Suite 310
    San Diego, CA 92101
    +1 (858) 422-6466
Resources
  • Support
  • Site Documentation
  • Site Status
  • SourceForge Reviews
SourceForge logo
© 2026 Slashdot Media. All Rights Reserved.
Terms Privacy Opt Out Advertise
MongoDB Logo MongoDB