File:  [XINU] / xinu / sys / test.c
Revision 1.1.1.2 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:39:56 2018 UTC (8 years, 3 months ago) by root
Branches: xinu, MAIN
CVS tags: xinu-19910600, HEAD
Xinu for 68000/68010

#include <stdio.h>
int workcount = 0;

main()
{
  int nwork, work();

  printf("Enter cycles of work to do: ");
  scanf("%d",&nwork);
  resume(create(work,1000,20,"worker",1,nwork));
  while (1)
    {
      getc(CONSOLE);		/* wait for <CR> from keyboard */
      printf("worker at # %d\n",workcount);
    }
}

work(ncycles)
{
  int i;
  printf("Worker starting\n");
  for (i=1;i<=ncycles;i++)
    {
      docycle(i);		/* do ith work cycle */
      workcount++;		/* count it where parent can see it */
    }
}

docycle(n)
int n;
{
  int i;
  for (i=0;i<n;i++);
}

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.