You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

35 lines
960 B

/* ex2.c - main, sndA, sndB */
#include <xinu.h>
void sndA(void), sndB(void);
/*------------------------------------------------------------------------
* main -- example of creating processes in Xinu
*------------------------------------------------------------------------
*/
void main(void)
{
resume( create(sndA, 128, 20, "process 1", 0) );
resume( create(sndB, 128, 20, "process 2", 0) );
}
/*------------------------------------------------------------------------
* sndA -- repeatedly emit 'A' on the console without terminating
*------------------------------------------------------------------------
*/
void sndA(void)
{
while( 1 )
putc(CONSOLE, 'A');
}
/*------------------------------------------------------------------------
* sndB -- repeatedly emit 'B' on the console without terminating
*------------------------------------------------------------------------
*/
void sndB(void)
{
while( 1 )
putc(CONSOLE, 'B');
}