Skip to main content

Dangling references

I picked up my data structures book and started reading it. First thing that came to my mind is, If I were a teacher, how would I explain to students on pointer concepts. Believe me, it is still a challenging concept to comprehend.
Pointer is a like a phone number to reach a person. Pointer points to address of the object that holds the data. Now, what is dangling reference. It is possible that there can be many pointer variables pointing to same address. For example, You, myself, someone else can have the same phone number of the person to reach. Question: What if the person dies? :) I still will have phone number, but cannot reach him or her. On top of that, what if that phone number gets assigned to some other person. In that case, I will reach the wrong person. The phone number I have is a dangling reference. Pointer pointing to the address, but address does not hold the desired object anymore ...

Simple, isnt it?

Comments

Popular posts from this blog

Essential GCP services for a new age application

Identity and resource management IAM  Identity aware proxy Resource Manager Stackdriver Monitoring Stackdriver Monitoring: Infrastructure and application monitoring Stackdriver Logging: Centralized logging Stackdriver Error Reporting: Application error reporting Stackdriver Trace: Application performance insights (latency) Stackdriver Debugger: Live production debugging Development management Cloud Deployment Manager: Templated Infrastructure deployment Cloud Console: Web based management console Cloud shell: Browser based terminal/CLI Development tools Cloud SDK: CLI for GCP Container registry: Private container registry Container builder: Build/Package container artifacts Cloud source repository: Hosted private git repository Database services Cloud SQL: Managed MySQL and PostgreSQL Cloud BigTable: HBase compatible non-relational DB Cloud Datastore: Horizontally scalable non-relational (ACID) Cloud Spanner: Horizontally scalable relation...

GCP: GAE - Memcache best practices

Memcache is a distributed in-memory data cache in front of or in place of robust persistent storage for some tasks. GAE includes a memory cache service for this purpose. Best practices for using memcache: 1. Handling memcache API failures gracefully; Do not expose errors to the end users 2. Use batching capability of the API when possible 3. Distribute load across your memcache keyspace Use sharding and aggregating for improving performance efficiency. Use TTL (expiration policy) to make sure the memcache does not fill-up indefinitely Use getIdentifiable() and putIfUntouched() for managing the values that may get affected by concurrent updates Use batching (getMulti ("comments", "commented_by") ) to fetch related values together instead of one by one Use graceful error handling

RAID Levels: Redundant Array of Independent Disks

Standard RAID levels comprise of configurations that employ the techniques of * STRIPING * MIRRORING * PARITY  to create large reliable data stores using general purpose HDDs. Levels are standardized by SNIA (Storage Networking Industry Association) in Common RAID Disk Drive Format (DDF) RAID 0 >> STRIPING (No fail-over, No Redundancy, Total loss of information if disk fails, each disk size will be of smallest disk size in the set of the disks) RAID 1 and its variants >> MIRRORING (Copy of write will be in more than one disk, Redundancy, less performant) RAID 5 >> Distributed PARITY RAID 6 >> Dual PARITY Source:   Wikipedia