STIW3054-A172 / Main-Issues

1 stars 1 forks source link

IRIA-2018 #18

Closed zhamri closed 6 years ago

zhamri commented 6 years ago

INSTRUCTIONS:

  1. Go to IRIA-2018.
  2. Choose 1 application.
  3. Capture the poster.
  4. Propose 5 concurrency topics/theories and also explain where those topics/theories can be applied in the application.
  5. Post your answer here.
kzkit commented 6 years ago

Application that I chose : YDot Real-Time Tracking System

ydot

Concurrency Topics

  1. Reentrant Lock - YDot can implement reentrant lock to only allow one device from multiple devices to interact with YDot.

  2. ExecutorService - In general, the ExecutorService will not be automatically destroyed when there is not task to process. It will stay alive and wait for new work to do. Using shutdown() to close the task process will allow the application to use the least amount of memory possible in the smartphone's memory.

  3. Atomicity - It is to prevent thread interference without resorting to synchronization like using AtomicCounter. This will prevent the application from getting results from all the YDot devices when running multiple search queries, it will not display redundant results without comparing the GPS devices.

4.Scheduled Executors - Capable of scheduling tasks to run either periodically or once after a certain amount of time has elapsed. YDot can send scheduled locations to the application every 3 second rather than every 1 second to discourage overusing the memory of the smartphone.

5.Callable and Future - Using callable and future allows the user to execute other tasks such as searching for a location in the map in parallel while the query is being executed, and then use future.get() method to retrieve the GPS location while user can do other tasks.

AsadRazali commented 6 years ago

Chosen application is Take A Number System

img_6676

Synchronized

Reentrant Lock

Scheduled Executors

Atomicity

Guarded Blocks

adamrustam commented 6 years ago

The application that i choose is BIKETRACKER.

img_2940

BIKETRACKER

Executor services - It can be implemented on this application because it provides mechanism for safely starting, closing down, submitting, executing and blocking on the successful or abrupt termination of tasks.

Atomicness - This systems should implement atomicity by providing some mechanism to indicate which task have started and which finished and keeping a copy of data about previous cyclist location before any changes occured.

Synchronization - Biketracker should implement this method to ensure only one message at a time can access alert signal, which we might cause data courruption if it accessesed by more authenticate tracker at a time.

ScheduledExecuter - This method should be applied on this application to run schedule task constantly or one at a time.

ReentrantLock – By reentrant it can compare and sweep which perform better especially in low contention.

ghost commented 6 years ago

Application that i choose is : Based Intelligence Irrigation System

screen shot 05-13-18 at 01 16 am

Executor services - It can be implement on this application because it can provides mechanism for safely starting, closing down, submitting, executing and blocking on the successful or abrupt termination of tasks.

Reentrant Lock - This system must have reentrant lock to make sure resources released after complete use and unlock to another thread. This reentrant lock can make power to create fair lock and flexibility to try for lock without blocking.

Non-synchronized guarded block - The execution to keep executing a blank loop until the condition becomes true. This approach has an obvious disadvantage of wasting the precious CPU time, which could have been better utilized by some other threads otherwise.

Concurrency-Level - Helping system to defines the number which is an estimated number of concurrently updating threads. The implementation performs internal sizing to try to accommodate this many threads.

Callable and Future - Using callable and future allows the user to execute other tasks in parallel while your submitted task is executing, and then use future.get() method to retrieve the result of the futu

AdlanShahjehan commented 6 years ago

img_20180507_154552

MOBILE TRADITIONAL MEDICINE

ReentrantLock - By reentrant it can compare and sweep which perform better especially in low contention

Synchronization - Take A Number System should implement synchronization to allow only one person get a number when system have multiple access to get a number at the same time.

Executor services - It can be implemented on this application because it provides mechanism for safely starting, closing down, submitting, executing and blocking on the successful or abrupt termination of tasks.

ScheduledExecuter - This method should be applied on this application to run schedule task constantly or one at a time.

Non-synchronized guarded block - The execution to keep executing a blank loop until the condition becomes true. This approach has an obvious disadvantage of wasting the precious CPU time, which could have been better utilized by some other threads otherwise.

umarabdullah commented 6 years ago

whatsapp image 2018-05-13 at 10 01 20 am

ScheduledExecuter : An ExecutorService that can schedule commands to run after a given delay, or to execute periodically. The schedule methods create tasks with various delays and return a task object that can be used to cancel or check execution. The scheduleAtFixedRate and scheduleWithFixedDelay methods create and execute tasks that run periodically until cancelled. It can check the position of the sun from time to time so as to know whether the photo volcanic panels should be re-adjusted or not

Guarded block : Threads often have to coordinate their actions. The most common coordination idiom is the guarded block. Such a block begins by polling a condition that must be true before the block can proceed. We could implement guarded blocks to create a the solar tracker application. This kind of application shares data between two threads: the solar position, that creates the data, and the photo volcanic panels, that does something with it. The two threads communicate using a shared object. Coordination is essential: the panels thread must not attempt to retrieve the data before the solar position thread has delivered it, and the solar position thread must not attempt to deliver new data if the panels hasn't retrieved the old data.

Synchronization : Threads communicate primarily by sharing access to fields and the objects reference fields refer to. This form of communication is extremely efficient, but makes two kinds of errors possible: thread interference and memory consistency errors. The tool needed to prevent these errors is synchronization. Synchronized Methods describes a simple idiom that can effectively prevent thread interference and memory consistency errors. In other to make sure memory consistency errors does not occur in our project we need to implement the synchronized methods in other to prevent starvation we could also enforce atomicity.

Interrupt : An interrupt is an indication to a thread that it should stop what it is doing and do something else. It's up to the programmer to decide exactly how a thread responds to an interrupt, but it is very common for the thread to terminate. This is the usage emphasized in this lesson. A thread sends an interrupt by invoking interrupt on the Thread object for the thread to be interrupted. For the interrupt mechanism to work correctly, the interrupted thread must support its own interruption. In this app we want to our panels to always face the sun position, in this case if the panels are still acting on old data it has to be interrupted and face the current sun position.

Atomic Access: In programming, an atomic action is one that effectively happens all at once. An atomic action cannot stop in the middle: it either happens completely, or it doesn't happen at all. No side effects of an atomic action are visible until the action is complete. in this application it could be applicable to the solar panels and its positions.

thiviya commented 6 years ago

1

Concurrency Topics

Reentrantlock : Whenever a thread tries to access a synchronized block or method, it acquires the intrinsic lock or the monitor on that object. In case of static methods, the thread acquires the lock over the class object. An intrinsic locking mechanism is a clean approach in terms of writing code, and is pretty good for most of the use-cases.

synchronization : There is a need to synchronize the action of multiple threads and make sure that only one thread can access the resource at a given point in time. This is implemented using a concept called monitors. Each object in Java is associated with a monitor, which a thread can lock or unlock.

Concurrency-Level : Is used as a hint for internal sizing. The table is internally partitioned to try to permit the indicated number of concurrent updates without contention.

ExecutorService : An ExecutorService can be shut down, which will cause it to reject new tasks. Two different methods are provided for shutting down an ExecutorService. The shutdown() method will allow previously submitted tasks to execute before terminating, while the shutdownNow() method prevents waiting tasks from starting and attempts to stop currently executing tasks. Upon termination, an executor has no tasks actively executing, no tasks awaiting execution, and no new tasks can be submitted. An unused ExecutorService should be shut down to allow reclamation of its resources.

SchedulesExecutorService : schedule commands to run after a given delay, or to execute periodically

Nurzyra commented 6 years ago

3

Concurrency Topics Mobile Traditional Medicine

Scheduled Executer - To run the scheduled task constantly.

Executor services - This application can be shut down, start, submitting tasks or reject a task.

Synchronization - There need to synchronize for allows only one person to get a number when the system has multiple access to get the number at the same time.

Reentrant Lock - This application must implement reentrant lock to show which traditional medicine is better

rubenmuhajir commented 6 years ago

32286641_2256458121038715_3026003299837935616_n

Concurrency Topics

  1. Reentrant Lock: Able to lock interruptibly. Able to timeout while waiting for lock. Power to create fair lock. API to get list of waiting thread for lock. Flexibility to try for lock without blocking.

  2. Synchronization: Synchronized blocks in Java are marked with the synchronized keyword. A synchronized block in Java is synchronized on some object. All synchronized blocks synchronized on the same object can only have one thread executing inside them at a time. All other threads attempting to enter the synchronized block are blocked until the thread inside the synchronized block exits the block.

  3. Callable and Future: Java Callable tasks return java.util.concurrent.Future objects. Java Future provides a cancel() method to cancel the associated Callable task. This is an overloaded version of the get() method, where we can specify the time to wait for the result. It’s useful to avoid a current thread getting blocked for a longer time. Please note that the get method is a synchronous method. Until the callable finishes its task and returns a value, it will wait for a callable. There are also isDone() and isCancelled() methods to find out the current status of an associated Callable task.

  4. Interrupt: An indication to a thread that it should stop what it is doing and do something else. It's up to the programmer to decide exactly how a thread responds to an interrupt, but it is very common for the thread to terminate. This is the usage emphasized in this lesson. A thread sends an interrupt by invoking interrupt on the Thread object for the thread to be interrupted. For the interrupt mechanism to work correctly, the interrupted thread must support its own interruption.

  5. Guarded Block: Threads often have to coordinate their actions. The most common coordination idiom is the guarded block. Such a block begins by polling a condition that must be true before the block can proceed. There are a number of steps to follow in order to do this correctly. Suppose, for example guardedJoy is a method that must not proceed until a shared variable joy has been set by another thread. Such a method could, in theory, simply loop until the condition is satisfied, but that loop is wasteful, since it executes continuously while waiting.

thilagan7 commented 6 years ago

whatsapp image 2018-05-13 at 10 39 03 pm

  1. synchronization: Sign Language translator system should implement synchronization to allow only one thread to access the resource at a given point in time. All other threads attempting to enter the synchronized block are blocked until the thread inside the synchronized block exits the block.

  2. Reentrant lock: This system must have the reentrant lock to make sure resources released after complete use and unlock to another thread. This reentrant lock can make power to create a fair lock. Flexibility to try for the lock without blocking.

  3. interrupt: An indication of a thread that it should stop what it is doing and do something else. A thread sends an interrupt by invoking interrupt on the Thread object for the thread to be interrupted. For the interrupt mechanism to work correctly, the interrupted thread must support its own interruption.

  4. ExecutorService: It can be shut down, which will cause it to reject new tasks. Two different methods are provided for shutting down an ExecutorService. Upon termination, an executor has no tasks actively executing, no tasks awaiting execution, and no new tasks can be submitted. An unused ExecutorService should be shut down to allow reclamation of its resources.

  5. Callable and future: It’s useful to avoid a current thread getting blocked for a longer time. Please note that the get method is a synchronous method. Until the callable finishes its task and returns a value, it will wait for a callable.

Shanthini21 commented 6 years ago

39963753-3dd4f20e-56a7-11e8-8aa7-44fc52462e0e

• Synchronization in java is the capability to control the access of multiple threads to any shared resource. For instance in this case, the application has to be able to remind the user each and every reminder she/he has set it regardless the item is the same or varied. Every reminder has to show the correct list each time without getting mixed up. • ExecutorService is also needed in order to set corePool size,maxPool size, workQueue,keepAlivetime,threadFactory and rejectedExecutionHandle. In this application, the workQueue task can be implemented as every task is been added to the application. The maximum amount of work has to fixed so that the user will be notified that they have reached the limit when there are too much of reminders have been added instead of crashing the application. • Basically, a ReadWriteLock is designed as a high-level locking mechanism. In this application it increases the throughput by allowing multiple threads to read the data concurrently(the items which are added to the list) and one thread to update the data exclusively(updating the time and date of the reminder). • Callable method is needed to call the object that has been set by the user in this application by implmenting the ExecutorService by using the submit() method. • Runnable method is something crucial in this application as it is needed to run and execute the threads that is created.

syaba314 commented 6 years ago

Application-Take A Number System whatsapp image 2018-05-14 at 8 46 12 pm

ScheduledExecutor- it can schedule tasks to run after a delay, or to execute repeatedly with a fixed interval of time in between each execution to apply into this application to able user to get a new number.

Queues -a methods to add an item to the queue, waiting for space to become available in the queue if necessary which can be apply to this application for next user in take a new queue number continuously.

ReentrantLock-Once a current number is locked, the lock hold count is increased by number when new user take the number.

ExecutorService-It can keep hold the number until another user enter to get a new number by submit to call.

SynchronizedBlock- use to counting by increase the number of the queue.

ZmahHata commented 6 years ago

img_20180507_125342

Reentrant Lock - This system should have re-entrant lock to create positive resources discharged once complete use and unlock to a different thread. This re-entrant lock will build power to form truthful lock and adaptability to do for lock while not obstruction.

Non-synchronized guarded block - The execution to stay execution a blank loop till the condition becomes true. This approach has an understandable disadvantage of wasting the valuable computer hardware time, that may are higher used by another threads otherwise.

Executor services - It are often implement on this application as a result of it will provides mechanism for safely beginning, closing down, submitting, execution and obstruction on the thriving or abrupt termination of tasks.

Callable and Future - Using callable and future permits the user to execute different tasks in parallel whereas your submitted task is execution, so use future.get() method to retrieve the results of the longer term.

Concurrency-Level - Helping system to defines variety|the amount|the quantity} that is AN calculable number of at the same time change threads. The implementation performs internal filler to do to accommodate this several threads.