Posts

Showing posts from April, 2023

CST 334 - Week 8 (Final Week)

 Last week we studied persistence as it relates to computer science.  Persistence is how the computer stores data and information for long periods of time even after the computer is shut down and does not have power.  This term persistence does not only apply to computer science but can also apply to life as well as school.  Hard work, studying, and practice are all forms of persistence.  If you are persistent and apply yourself and goals you have can be accomplished.

CST 334 - Week 7

 The course is coming to an end and for this last week of new content, we studied persistence.  Persistence, as it relates to computer science, is how information and data are stored and accessed even after the application has been closed or the computer has been turned off.  The word persistence encompasses many different topics such as I/O devices, hard disk drives/solid state drives, RAID, and file systems.  I will provide examples of each below. I/O devices are input and output devices that are connected to the computer through a bus.  These buses have many different kinds of connectors such as PCI, SATA, USB, etc.  Examples of devices that are connected to the CPU through these buses are graphics cards, drives, mice, etc. Hard disk drives/solid state drives are storage mediums that contain sectors on them that data can be written to or read from.  These HHDs/SSDs are the main source of persistent data that is stored on a system. RAID or redundant ...

CST 334 - Week 6

 This week we studied semaphores as well as possible problems with concurrency.  Semaphores are objects with an integer variable that assist in synchronizing a program with multiple threads.  They are similar to using locks and conditions in the sense that they help to control access to shared resources such as files or memory.  The integer the semaphore carries can either be zero, which means the process that called for the semaphore is blocked, or it can be another integer greater than zero, which means the process now has access to the resource it is requesting.   Concurrency bugs are another topic studied this week.  These are bugs that can arise with multi-threaded programs or running multiple applications at once.  An example of a concurrency bug is an atomicity violation bug.  This type of bug occurs when two or more threads access a value at the same time or before the previous thread has a chance to finish with the variable.  As...

CST 334 - Week 5

This week was about concurrency.  More specifically about multithreaded programs.  A thread is an abstraction of a single process.  They are similar to a process except that threads share the same address space as the process that created them.  Threads are also indeterminate which means they will run at a different time producing different results every time the program is run.  This issue can be solved using locks which will prevent threads that are running at random times to wait until the desired thread completes what the program intends.  Threads are very useful because it allows a process to handle multiple lightweight tasks at the same time. We also had some hands-on work with threads in the lab for this week.  This lab created 10 threads that would pass an incrementation counter to another function that would output text to the screen.  When running this program a bug would occur that would sometimes show the same number for the increment ...