Linked Lists

Since arrays must be made of a contiguous section of memory, large arrays become harder to allocate memory for them, especially as the application becomes more complex. Therefore, developers will often look to using something like a linked list. A linked list incorporates a custom data type. One of the data types which makes it…

Requirements for Efficient Memory Management

Logical vs Physical memory A computer’s physical memory (RAM) is a hardware structure consisting of a linear sequence of words that hold a program during execution. A word is a fixed-size unit of data. The size of a word is reflected in many aspects of a computer’s structure and operation. A typical word size is 4 to 8 bytes…

Unit Tests

Unit testing is a form of software testing where you test small individual “units” of code. Each unit tested might be associated with a small sub-section, like a function. The associated control data, usage procedures, and operating procedures, are tested to determine whether the unit is ready for use, or at least the next set…

Multi-Tier Applications

Object oriented languages do a good job of helping you learn to separate out the process of working with different data elements. This concept can be extended to get you toward an important software development concept: multi-tier applications. In the “old days” a program would pull data from a data source, store that information, perform…

Deadlock Detection

A deadlock in a resource allocation graph can be detected by executing a graph reduction algorithm by repeating this process: Select an unblocked process p. Remove p, including all request and allocation edges connected to p. Anything left is blocked, and risks deadlock. However, it is considered completely reducible if there are no processes left…

A System Model for Deadlocks

A resource allocation graph shows the current allocation of resources to processes and the current requests by processes for new resources. Processes are represented by circles. Resources are represented by rectangles. Small circles designate multiple units within a resource. Resource allocations are represented by edges directed from a resource to a process. Resource requests are represented by…