Ada's SELECT in C

Pattara Kiatisevi pkiatisevi at student.ei.uni-stuttgart.de
Fri Mar 1 16:07:06 UTC 2002


Ok, I get it worked with pthread now, code is much longer and more
complex). But hmm, now I can't find the libpthread.a for
SPARC/LEON....does it exist?

Thanks,
Pattara

On Thu, 28 Feb 2002, Pattara Kiatisevi wrote:

> Hi,
>
> 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) {
>     decode_music_from_input_to(buffer[currentbuffer]);
>     Play.goPlay(currentbuffer); // Block if Player is still busy
>     Change value of currentbuffer to whatever e.g. +=1
>   }
>   play.stop();
> }
>
> Player {
>   forever {
>    Select
>      Accept Stop() : exit ;
>      Accept Goplay(currentbuffer) :  // only this line in rendezvous
>        Outputsound(buffer[currentbuffer]);
>        //this output sound could block
>    End Select;
>   }
> }
>
> Thank you for all the answer(s),
> Pattara
> --
> Please avoid sending me Word or PowerPoint attachments.
> See http://www.fsf.org/philosophy/no-word-attachments.html
> ----------------------------------------------------------------------
> Ott Pattara Kiatisevi 				   T L W G
> M.Sc. INFOTECH Student, Stuttgart, Germany	http://linux.thai.net/
> ----------------------------------------------------------------------
>
>
>




More information about the users mailing list