Back
ExamFull examExam paper only

2015 07 13

Full exam for Middleware Technologies for Distributed Systems in the Computer Engineering degree programme at Politecnico di Milano. The document covers: 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

Middleware Technologies for Distributed SystemsFull exam

Document information

What's included in this study material

Full exam for Middleware Technologies for Distributed Systems in the Computer Engineering degree programme at Politecnico di Milano. The document covers: 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

Import quality: text was extracted directly from the original document.

Extracted content from the document

Representative passages recognised in different parts of the material. The full extracted text remains available to search, while this compact preview makes the page easier to read.

Page 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…

Preview

First page of the document.

First page: 2015 07 13