← Indietro
EsameEsame completoTesto d’esame

2015 07 13

Esame completo di Middleware Technologies for Distributed Systems per il corso di Computer Engineering presso Politecnico di Milano. Materiale proveniente dall’archivio storico Studwiz e classificato per la consultazione online.

Middleware Technologies for Distributed SystemsEsame completo

Informazioni sul documento

Cosa trovi in questo materiale

Esame completo di Middleware Technologies for Distributed Systems per il corso di Computer Engineering presso Politecnico di Milano. Materiale proveniente dall’archivio storico Studwiz e classificato per la consultazione online.

Qualità dell’importazione: il testo è stato estratto direttamente dal documento originale.

Contenuti estratti dal documento

Passaggi rappresentativi riconosciuti nelle diverse parti del materiale. Il testo completo resta presente nella pagina per la ricerca, mentre l’anteprima compatta rende più semplice la lettura.

Pagina 1

Politecnico)di)Milano))Middleware)T echnologies)for)Distributed)Systems))) 13th)of)July)2015)Rules: •)You are not allowed to use books, notes, or other material. •)You can answer in Italian or English. •)Total time for the test: 1.5 hours. •)Check the back of this page for any additional exercises. 1.)Use Java to implement a MsgBatcher class that holds a (finite) set of messages and sends them, on request, in batch. Suppose we have a Message class with a method void send(). MsgBatcher provides a method void enqueue(Message) to add a new message to the batch. It suspends the caller if the MsgBatcher is full (the maximum number of messages that can be enqueued is provided in the MsgBatcher constructor). A method void sendAll() is also provided to send all messages enqueued up to that moment (it empties the MsgBatcher). Organize synchronization that will take care of the fact that sending a message may take a long time. Optional: implement the sendAll method so that the sending is performed asynchronously w.r.t. the caller (i.e., in a separate thread, which should be started at MsgBatcher creation time and reused for each sending). 2.)Write in TinyOS the Counter module, which provides a command to increment the counter and an event that is notified when the couter has been incremented 100 times. The event provides the total number of increments done since the last reset. The counter can be reset with an ad-hoc command, but it also resets automatically every 10 seconds. Introduce two additional commands, start and stop, to enable or disable this "auto-reset" feature. Write the interface and the implementation of the module. The following interfaces may help you: interface Timer<precision_tag> { command void startPeriodic(uint32_t dt); command void startOneShot(uint32_t…

Anteprima

Prima pagina del documento.

Prima pagina: 2015 07 13