Ada's SELECT in C

Joel Sherrill joel.sherrill at OARcorp.com
Fri Mar 1 16:15:06 UTC 2002



Pattara Kiatisevi wrote:
> 
> 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?

If you configured RTEMS with --enable-posix, then it is in the
main RTEMS library.  You should link against it by default.

--joel

> 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/
> > ----------------------------------------------------------------------
> >
> >
> >

-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel at OARcorp.com                 On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
Support Available                (256) 722-9985



More information about the users mailing list