Ada's SELECT in C

Pattara Kiatisevi pkiatisevi at
Thu Feb 28 17:45:56 UTC 2002


I have a not-so-directly-involved-with-RTEMS question but just ask for
conceptual idea. As I learnt the syntax "SELECT" in ADA and now have to
program with pthread on RTEMS. Anybody knows how to translate the
following snippet of psuedo code into pthread's concept?

buffer_t buffer[xxx];
task Player;

main {
  int currentbuffer = 0;
  Create and run Player task;
  while(input not EOF) {
    Play.goPlay(currentbuffer); // Block if Player is still busy
    Change value of currentbuffer to whatever e.g. +=1

Player {
  forever {
     Accept Stop() : exit ;
     Accept Goplay(currentbuffer) :  // only this line in rendezvous
       //this output sound could block
   End Select;

Thank you for all the answer(s),
Please avoid sending me Word or PowerPoint attachments.
Ott Pattara Kiatisevi 				   T L W G
M.Sc. INFOTECH Student, Stuttgart, Germany

More information about the users mailing list