1. Homepage
  2. Programming
  3. CSC8016: Advanced Concurrent Programming Coursework: Forum platform

CSC8016: Advanced Concurrent Programming Coursework: Forum platform

Engage in a Conversation
NCLCSC8016Advanced Concurrent ProgrammingJavaForum platformThread

Use Case Scenario CourseNana.COM

Coursework CourseNana.COM

We want to implement a forum platform (Blog), where users are opening topic threads for discussions (createNewTopicThread) and posting some comments (addPostToThreadId). When a topic thread is opened, there might be no messages available. We also freely assume that all the users are also moderators, thus allowing to remove specific threads as a whole (removeTopicThreadById). We do not consider the possibility of removing single messages within a topic thread. In addition to this, we might also freely assume that each user might retrieve all the available topic threads names sorted by published date (getAllTopics) as well as their IDs (getAllTopicIDs); a user can also retrieve all messages from a specific topic thread (getAllMessagesFromTopic). Furthermore, the user might be also want to retrieve the latest available update event within the server (pollForUpdate) if available and otherwise wait; an eponymous method also accepting the previous message update as an argument will only return if a new event being different from the one being provided as an argument is effectively generated by one of the users using the platform. When required, the users receive the feedback on their operation’s status through either a boolean (true for successful, false for error or unsuccessful) or a TopicUpdates message. The latter class shall not be changed by the student. CourseNana.COM

We might freely assume that such platform acts as a monitor, where requests are handled through method invocation. For synchronising read and write operations over the server, the students shall only use the ReadWriteMonitorMultiRead to guarantee the main synchronisation mechanism. CourseNana.COM

In this scenario, the users should be allowed to perform all of the aforementioned operations con- currently with no race conditions. Using 2PL transactions or ensuring the fairness over reader and writing threads is not strictly required. CourseNana.COM

Assumptions CourseNana.COM

  • In a realistic example, communications happen through restful HTTP requests, and the Blog is actually an HTTP server. In this module, we don’t require that. We can freely assume that each user is mimicked by one single thread. We assume they directly exploit such an interface (no FrontEnd or HTTP requests are required!) CourseNana.COM

  • The student shall keep the same package structure, as the tests will assume to access the classes within the uk.ncl.CSC8016.jackbergus.coursework.project3 package. The students might consider extending the tests for ensure the code correctness. Still, the overall work will be assessed through our provided code, and not theirs! CourseNana.COM

    1 CourseNana.COM

  • Thestudentsshallfreelyassumethatthemainserver,Blog,willbeanadvancedmonitor,where an instance of the ReadWriteMonitorMultiRead is going to provide the required ReentrantLock mechanism. CourseNana.COM

  • The student might try to implement such a server as a (multi)Thread service via a thread pool to gain extra points, but this is not strictly required. In this case, the student might freely assume that the thread pool is started by calling the Blog constructor, and one single thread will stop the thread pool if there is any inactivity for more than 30 seconds. Such pooled threads might receive the client’s method invocation as a sequence of “client messages” through shared variables, where requests need to be handled FIFO. The client will return from its method invocation once the message is handled successfully by one of the threads. Still, this should require not changing the strict assumption over the API being provided, which should not be by any means changed. CourseNana.COM

  • We assume that no user registration, logging, or ban, is given. Additional features going beyond the specifications within the marking scheme will not be evaluated. CourseNana.COM

  • The server should allow the creation of multiple topics with the same name and different and incremental ID as far as different timestamps are given to distinguish them. In order to maximise seriality and concurrency requirements, the students might investigate optimistic protocols, thus allowing the concurrent posting across different topic, as this will give the chance to gain extra points. CourseNana.COM

    Submission Requirements CourseNana.COM

    1. To help us with the marking, the students should update the studentID method so to return a string corresponding to their student id. This will help us expediting the marking using our automated tool. CourseNana.COM

    2. BlogandReadWriteMonitorMultiReadshouldbefinalised,asthecurrentimplementationdoes not pass the provided tests! The latter class should be used within the former as a main reentrant locking mechamism for the Blog monitor (or thread-pool server). CourseNana.COM

      The TopicUpdates class CourseNana.COM

    3. The student shall submit the code as a zipped Maven project via File > Export > Project to Zip file... with no jar and classes. The source code will be recompiled from scratch, and no pre-compiled jar/class is going to be run. CourseNana.COM

    4. If you want to use an external Java library, please consider the following: CourseNana.COM

      • The Java library should be explicitly described as a <dependency> in the pom.xml file, and CourseNana.COM

        should only access the libraries from the default Maven Central Repository. CourseNana.COM

      • A library might provide single concurrency mechanisms primitives, but not ready-made solutions already composing those: semaphores, monitors, locks, just logs, thread barriers, thread pools, passing le baton mechanisms are allowed. Code reuse from the exercises and examples seen in class is permitted. CourseNana.COM

      • Systems completely solving the coursework for you are strictly prohibited: e.g., any kind of (data) management system having concurrency control (ensuring safe concurrent thread access to any data representation) and supporting concurrent transactions (implementing any kind of transaction protocol, either pessimistic or optimistic) must be avoided, as they both implement commit/aborts and thread-safe operations on data. CourseNana.COM

        2 CourseNana.COM

None of the (direct or indirect) dependencies of the coursework should rely on external servers or processes to run or to be installed. CourseNana.COM

The solution should not include external jar files. CourseNana.COM

If unsure whether the solution might be exploited, please ask before submitting. CourseNana.COM

5. Attached to the source code, please provide a short report motivating the compliance of the source code to each point and sub-point of the marking scheme. Providing such report in form of comments in the implementation is also fine. New classes might be created for supporting the implementation, but existing classes should be neither renamed or moved to a different package. CourseNana.COM

Marking Scheme CourseNana.COM

The marking scheme is capped at 100%. Single-Thread Correctness [+50%] CourseNana.COM

+4%: I cannot interact with a blog thread if this was not previously created.. You should not be able to remove a non-existing topic thread.
You cannot post a comment over a non-existing topic thread.
You cannot read the posted messages for a non-existing topic thread. CourseNana.COM

+16%: I can always interact with a topic thread that was previously created. You can create a new topic thread.
You can post a message within an existing topic thread.
You can correctly read all the messages in their order of appearance. CourseNana.COM

+4%: I am correctly handling the thread closure for an existing topic thread.
+7%: I am correctly handling the pollForUpdate method where, if successful requests are CourseNana.COM

always fired before polling for events, should always return the most recent event available. CourseNana.COM

You only retrieve the latest update event. CourseNana.COM

Youcancorrectlydetectalltherequiredinteractioneventsoftheusersovertheplatform. CourseNana.COM

+3%: If no user performs any suitable action, pollForUpdate should pause indefinitely. CourseNana.COM

+10%: I am correctly handling the set method from ReadWriteMonitorMultiRead (please see the documentation of this method for additional information concerning its expected behaviour). CourseNana.COM

+6%: I am correctly handling the get method from ReadWriteMonitorMultiRead (please see the documentation of this method for additional information concerning its expected behaviour). CourseNana.COM

Multi-Threaded Correctness [+50%]
+7%:
The concurrent creation of different topics is handled correctly. CourseNana.COM

Creating multiple topic threads does not raise deadlocks. CourseNana.COM

3 CourseNana.COM

CourseNana.COM

All the topics requests being sent are fulfilled and available in the exact same order of creation. CourseNana.COM

+9%: The concurrent posting of multiple messages within multiple topic threads is handled correctly. CourseNana.COM

Posting multiple messages across topics or within the same topics does not result into deadlocks. CourseNana.COM

All the messages being sent are fulfilled and available in the exact order of posting. CourseNana.COM

+12%: We have one querying user, one moderator user, and eight answering user. Each of those are simulated as distinct threads. The querying thread posts the topic and publishes the first comment within the thread; after receiving exactly 8 answers from the answering threads, the querying user posts a thank you message. The answering threads are waiting for the first message from the querying user to be posted, after which they provide a reply within the thread. The moderator thread will close all the topics reaching a number of 10 comments. CourseNana.COM

+12%: While having only one single user running and one subscriber to receive the updates from the website, no interference occurs, and all the perceived events actually match the expected results. CourseNana.COM

Advanced Features (capped at maximum 10%): CourseNana.COM

  • [+1%] The program allows to visually determine the correctness of the operations per- formed by the threads (e.g., terminal prints, engaging with extra tests not provided to the students, or graphical user interfaces). CourseNana.COM

  • [+1%] Any Java library imported via pom.xml ‘not violating the 3rd Submission Require- ment. The following libraries will not be considered, as already provided in the given source code as dependencies: annotations from org.jetbrains, and jansi from org.fusesource- .jansi. CourseNana.COM

  • [+1%]EitherthemethodstobeimplementedortheextendedtestsexploitJava’sconcurrent collections. CourseNana.COM

  • [+1%] The student correctly uses ReentrantLocks and Conditions within the ReadWrite- MonitorMultiRead class. CourseNana.COM

  • [+3%] The ReadWriteMonitorMultiRead provides a satisfactory extension of the classical ReadWriteMonitor by not only considering the number of services waiting to read and write a specific latest message update, but also waiting to have a new event being written different from the previously-obtained one. Furthermore, such class is actually used as the only way to deal with read-write operations within Blog, which are also handled correctly. CourseNana.COM

  • [+1%] Thread pools are used to either handle multiple requests from multiple users, or start multiple threads within the extended tests. CourseNana.COM

  • [+5%] The Blog service is emulated realistically as a separate thread accepting restful requests; this requires the Blog to handle requests one at a time through a queue; Still, the student shall not change the API interface as currently provided.  CourseNana.COM

Get in Touch with Our Experts

WeChat (微信) WeChat (微信)
Whatsapp WhatsApp
NCL代写,CSC8016代写,Advanced Concurrent Programming代写,Java代写,Forum platform代写,Thread代写,NCL代编,CSC8016代编,Advanced Concurrent Programming代编,Java代编,Forum platform代编,Thread代编,NCL代考,CSC8016代考,Advanced Concurrent Programming代考,Java代考,Forum platform代考,Thread代考,NCLhelp,CSC8016help,Advanced Concurrent Programminghelp,Javahelp,Forum platformhelp,Threadhelp,NCL作业代写,CSC8016作业代写,Advanced Concurrent Programming作业代写,Java作业代写,Forum platform作业代写,Thread作业代写,NCL编程代写,CSC8016编程代写,Advanced Concurrent Programming编程代写,Java编程代写,Forum platform编程代写,Thread编程代写,NCLprogramming help,CSC8016programming help,Advanced Concurrent Programmingprogramming help,Javaprogramming help,Forum platformprogramming help,Threadprogramming help,NCLassignment help,CSC8016assignment help,Advanced Concurrent Programmingassignment help,Javaassignment help,Forum platformassignment help,Threadassignment help,NCLsolution,CSC8016solution,Advanced Concurrent Programmingsolution,Javasolution,Forum platformsolution,Threadsolution,