In general, a commit procedure involves two transitions between three “trees”:
- from local tree -> staging
- from staging -> index
As a “treatment”, git-reset comes in three strengths:
- soft: reset the index tree only
- mixed: reset the staging tree too
- hard: reset local tree and all other trees
- StampedLocks were introduced in java8 only for internal/low-level utilities in the development of thread-safe components.
- main advantage over RWlock — optimisticRead, which can reduce writer starvation by readers
- main drawback — non-reentrant and prone to self-deadlock
— optimistic reading using a StampedLock object
A thread can hold this object in optRead mode. This mode can be thought of as an extremely weak version of a readLock, that can be broken by a writer at any time.
Your thread would first tryOptimisticRead() to get a temporary stamp. Then validate(theStamp) would pass iFF still “free”.
After first successful validation, you should quickly read just a few data items, and validate() again to confirm availability.
Remember that, with zero notice a writeLock can be created from this object, invalidating your optRead lock.
OptRead lock is designed for quick small reads, like stealing…
This class offers too many API methods. I wonder which ones are most often used. I hope the javadoc example helps.
— stamps are long integers
https://dzone.com/articles/a-look-at-stampedlock explains the stamps superficially.
Most if not all grab attempts return a stamp that is needed for unlocking or lock level upgrade/downgrade.
— why did they design this lock as non-reentrant? Must be some performance reason.
This construct is definitely designed for experts not the casual programmer.
— relation to the (interview-wise) hotter AtomicStampedReference
I don’t see any relation.
— PendingCancel report
— cancel completed i.e. Out report
Interviewers often focus on x86 instruction sets, but I could point out competing instruction sets.
- IBM’s PowerPC and Oracle’s Sparc — were a pair of once-popular instruction sets in HighPerformanceComputing. Even if they are less popular now, the still have a presence.
- AMD64 — instruction set (i.e. x86-64) was created at AMD, as an extension on x86
- IA-64 — instruction set was created at HP then Intel, widely deployed in data centers.
- ARM — If interview is not 100% focused on server-side, then I would point out ARM instruction set is dominant in handheld.
If there are many exit points including catch clauses, breaks from nested loops, and there are clean-up clauses at loop-ends, then void return is a loose design and /breed/ invisible coding errors like returning unintentionally.
NYFIX is a business, traded under the confusing ticker “NYFX”.
https://www.itiviti.com/managed-fix-services/nyfix-order-routing-network has a nice description.
I think NYFIX is a technology and “managed service” provider. I feel it might be similar to Bloomberg trading platforms.
What’s in common between a luxury car and a brank like “Director”?
- enviable, glamorous, glorifying
- high maintenance, high visibility
- you need some minimum personal capacity (“
performance“) to maintain it over a long time
- can wear out quickly, esp. when you age
- Not a passive income generator,
- perhaps not a reliable cash-cow asset,
My contractor job is like a mid-range reliable Japanese car.
— https://www.channelnewsasia.com/news/commentary/career-mobility-new-normal-career-stability-job-hopping-11469760 is a Singapore perspective:
Long gone is the notion of the career ladder, where the ideal CV looks like a narrow, vertical progression. Today’s gold-standard CV looks like a career matrix, with horizontal and vertical moves signifying depth and breadth of experience, skills and exposure to different cultures.
Employers have gone from being cynical about hiring job-hoppers to becoming accustomed to seeing diverse CVs from top talent who are in frequent demand.
I often say that the young, bright candidates basically ignore contract jobs — no benefit, no leave, no promotion prospect.
https://www.channelnewsasia.com/news/commentary/covid-19-coronavirus-job-work-tip-skills-government-support-hire-12509712 is a Singapore perspective:
“many jobseekers turn away such contracts, choosing to hold out for something long-term that may or may not come”
Given this log4j.cfg content,
- package1 classes’s logger output would go to log file specified
- other packages’s logger output would go to sysout
- System.out and System.err would go to sysout
- In my dev system, sysout messages are saved to a separate sysout log file.
I have seen that System.out is less likely buffered.
RTS uses no STL containers.
In my first programming job, I used C without malloc, because I used only array + struct. If my collection were to grow at run time, then I would have needed DAM.
I feel low latency generally avoid mid-day DAM. If DAM required, then pre-allocation is preferred.