Concurrent Programming Flashcards
Threads
Threads managed by the scheduler allow access to shared resources such as processors and variables
They can be different priority levels so that high priority reads get more processor time than low priority ones
Advantages
Users may interact with apps while tasks are running eg stopping file download in a web browser
Short running tasks aren’t delayed by long running ones eg a web page can be served whilst processing a query
Deadlock
Two threads depend on each other to finish before they execute the rest of their code
They never end and so are never executed
Race Condition
Two or more threads attempt to access a variable and are ‘racing’
Unpredictable results
Resource Starvation
High priority thread locks a lower priority thread out of the resources it requires to execute and so it never does
Concurrency Control
Ensuring that all threads operate in the correct sequence/priority
Other facts
Translation software is used to manage the execution of threads concurrently
Programmer writes the code to solve the problem but threading of translated code is carried out by software
Describe concurrent programming
- Code is run simultaneously
- Programming works the same as sequential programming
- Streams may interfere with each other
Evaluate suitability of design for touch screen/smartphone device
Reduced strain on resources
Easy to understand - users completes tasks quicker - resources freed quicker
Accuracy of info entered -
Potential misspelling of criteria when text entry used but offers flexibility
Selection of data eg calendar is more fiddly but provides accuracy
Examples of Intellectual Property Rights
Copyright - Gives original exclusive rights to any artwork
Trademarks - Use of these without permission is regarded as a breach of IPR
Why might a subclass only contain a limited number of instance variables?
It inherits all of the instance variables and there is no need to redefine them
How does encapsulation work on lines?
Method on a line can access instance variables since the instance is inside the class definition
How analytics which exhibit features of intelligent systems may be used in order to benefit commercial businesses
Analytics designed to recognise key words in posts and comments
Helps businesses to learn more about what people think of new products, adverts and developments
By analysing user posts, businesses can better understand customer preferences and improve their ability to detect potential problems