CSC8016 Advanced Programming, Coursework,

CSC8016 Advanced Programming, Coursework

Use Case Scenario:

In this coursework, we aim to implement a forum platform (Blog) enabling users to initiate topic threads for discussions (createNewTopicThread) and post comments (addPostToThreadId). Users, assumed to be moderators as well, have the authority to remove entire threads (removeTopicThreadById). However, we do not consider the removal of individual messages within a thread. Additionally, users can retrieve topic thread names sorted by publication date (getAllTopics) and their corresponding IDs (getAllTopicIDs). They can also retrieve all messages from a specific thread (getAllMessagesFromTopic).

Furthermore, users may request the latest update event within the server (pollForUpdate), waiting if no update is available. An analogous method, accepting the previous update as an argument, will return only if a new event differing from the provided one is generated. Feedback on operations` status is provided either through a boolean (true for success, false for error) or a TopicUpdates message.

The platform operates as a monitor, handling requests via method invocation. To synchronize read and write operations, the ReadWriteMonitorMultiRead is utilized as the primary synchronization mechanism.

All operations mentioned above should be performed concurrently without encountering race conditions. While the use of 2PL transactions or ensuring fairness between reader and writer threads is not mandatory, concurrency without race conditions is essential.

WhatsApp icon