Examples, Experiments, Research
Look. Try. Add.
👋 Welcome! This is the personal repository of a Full-Stack developer (.NET, C++, Angular), where I collect everything I’ve learned or discovered in real projects.
🔬 I don’t just read theory – I want to see how it works in practice! Here you’ll find hands-on examples of basic tools and practical solutions to complex problems you can try yourself.
💡 Even simple concepts are easy to forget, and revisiting them often means writing small console projects. To save time and stay organized, I keep everything in one structured place.
🤝 I’m open to collaboration!
📦 This repository is my personal experience vault, which will continue to grow. New examples, ideas, and practices appear as I learn and work on real projects.
Small for now 🌱 but growing with each step toward something greater 🌳!
Note: Tests containing
spinoryieldmay fail depending on the CPU.
🔀 Threads
- Create, Sleep, Join
- Create with arg
- Foreground
- Background
- Info, current thread instance
- Is alive
- Join with timeout
- Abort
- Affinity (run parameter)
- Affinity (programmatically)
- Suspend, Resume
- Suspend, Resume: Tick Tock
- Abort in Core via
CancellationTokenSource - Suspend-Resume in Core via
ManualResetEventSlim - Tick Tock in Core
lock()- Monitor.Enter - Monitor.Exit
- Wait Queue
- Monitor.PulseAll
- Monitor.Pulse
- Tick Tock via Monitor.Pulse - Monitor.Wait
- Monitor.Wait with timeout as Sleep
SpinLockvslock()- Spin lock as Sleep
- Spin lock for fast logging
- Spin lock throwing
SynchronizationLockException - Thread.Yield: fast cycle
- Thread.SpinWait: fast cycle
- SpinWait.SpinOnce
- SpinWait.SpinUntil
- Semaphore.WaitOne - Release
- Semaphore.Release max slots
- Semaphore: named for processes
- Semaphore: named created new
- Mutex as Monitor
- Mutex for singleton thread
- Mutex for singleton app
- Interrupt
- Deadlock: recursive locking
- Deadlock: mutual waiting, break by Interrupt
- Deadlock: mutual waiting, break by Join with timeout
- EventWaitHandle.Set
- EventWaitHandle.Reset
- EventWaitHandle.Set with auto-reset
- AutoResetEvent.Set
- ManualResetEvent.Set
- ManualResetEventSlim.Set
- ManualResetEventSlim.Wait with timeout
- CountdownEvent.Wait as Join
- CountdownEvent.AddCount
- CountdownEvent.TryAddCount
- CountdownEvent.IsSet
- CountdownEvent.Reset
- CountdownEvent.Reset with arg
- Barrier: Phases
- CancellationToken: create token
- CancellationToken: cancellation request
- CancellationToken: cancellation callback sequence
- CancellationToken: cancellation callback sequence: before first exception
- CancellationToken: cancellation callback sequence: all, ignoring exceptions
- CancellationToken.ThrowIfCancellationRequested
- CancellationToken.None usage
- CancellationToken.None variants
- CancellationTokenSource.CreateLinkedTokenSource
- QueueUserWorkItem
- QueueUserWorkItem with state
- QueueUserWorkItem Join
- Set pool thread as foreground
- Pool restores thread as background
- Synchronized method: instance
- Synchronized method: static
- Synchronized method: instance in different threads
- Synchronized method: static in different threads
- ThreadLocal<T>: counters
- Lazy<T>: lazy initialization
- Lazy<T>: single initialization
- Lazy<T>: multiple initialization
- Lazy<T>: unsafe initialization
- Note: disposable sync primitives
📋 Tasks
- Create task
- Task is in pool thread
- Wait task
- Wait task with timeout
- Task is running after wait timeout
- Wait task with cancellation token
- Wait blocks thread
- Wait wraps task exception into
AggregateException - Result
- Result blocks thread
- Result wraps task exception into
AggregateException - Delay
- Delay with cancellation token
- Delay is working after wait timeout
awaitreleases manual threadawaitreleases pool thread- Method with
async, withoutawaitis synchronous - Method with
async, withawaitis asynchronous - ConfigureAwait
- ConfigureAwait: effect on default sync context Post and Send
- ConfigureAwait: effect on UI sync context Post and Send
- Throwing task exception
- ContinueWith: created task status
- ContinueWith: task chain
- ContinueWith: variable continuation
- ContinueWith: continuation options
- ContinueWith: SetInterval(
- RunSynchronously
- RunSynchronously and continuation
- RunSynchronously and synchronous continuation
- RunSynchronously continuation
- Set status to
TaskStatus.Canceledafter cancellation byToken.ThrowIfCancellationRequested() - WhenAll
- WhenAll: task exceptions
- WhenAll with canceled task
- WhenAll with incorrect canceled task
- WaitAll
- WaitAll: task exceptions
- WhenAny
- WhenAny: timeout
- WhenAny: task exception
- WaitAny
- WaitAny: task exception
- WhenEach
- Yield
- Awaiter: GetResult
- Awaiter: OnCompleted
- Awaiter: pattern
- Awaiter: timespan awaiter
- TaskCompletionSource: timeout
- TaskCompletionSource: WithTimeout() extension
- TaskCompletionSource: external event source adapter
- FromResult
- FromCanceled
- FromException
- CompletedTask
- ValueTask: cached result
- Factory
- Factory: continuations
- Factory:
TaskCreationOptions.LongRunning - Factory: child task attachment,
TaskCreationOptions.DenyChildAttach - Factory: set task schedulers
🔗 LINQ
- Tree structure: view
- Tree structure: create: left operand via
Expression.MakeMemberAccess - Tree structure: create: left operand via
Expression.Property - Tree structure: create: 3 levels
- Lambda: create
Func1 - Lambda: create
Func2 - Lambda: parameter order
- Lambda: info
- Lambda: view with named parameters
- Lambda: typed vs untyped
- Lambda:
DynamicInvoke(): dynamicFunc - Lambda:
DynamicInvoke(): dynamic Add ExpressionType: list of all- Debug view
- Debug view: lambda
Reduce()ReduceAndCheck(): reducibleReduceAndCheck(): not reducibleReduceAndCheck(): prevent returnnullandthisReduceExtensions(): builtin rootReduceExtensions(): custom root: reducibleReduceExtensions(): custom root: not reducibleIsByRef: struct parameter: withrefmodifierIsByRef: reference parameter: withoutrefmodifierIsByRef: reference parameter: withrefmodifier- Visitor: root
- Visitor: tree: immutable
- Visitor: tree: with mutable child node
Expression.InvokeExpression.Call: instance methodExpression.Call: static methodExpression.NewExpression.MemberInit,Expression.BindExpression.MemberBindExpression.Quote: lambda returns lambdaExpression.Quote: lambda returns lambda: in DB providerExpression.AssignExpression.Block,Expression.Variable:Swap(x, y)Expression.Blockreturns last expression result- Conditional operators
Expression.ThrowExpression.Goto,Expression.Label: emptyExpression.Goto,Expression.Label: instructionExpression.Goto,Expression.Label: return valueExpression.ReturnlikeExpression.GotoExpression.ReturnvsExpression.Goto: semantic differenceExpression.ReturnvsExpression.Goto: call via kindExpression.Loop,Expression.Break: power to 10Expression.Loop,Expression.Break: select evenGotoExpressionKind: list of allExpression.TryCatchFinally- Reverse Polish Notation
- Auto-mapper
- SQL generation
EnumerableandQueryablemethod namesEnumerable.Range()Enumerable.Repeat()Enumerable.Empty()Aggregate()AggregateBy()All()Any()- All with
Any() - Any with
All() Append()Average()Cast(): numbersCast(): classesChunk()Concat()Contains()Count()CountBy()DefaultIfEmpty()Distinct()DistinctBy()ElementAt()ElementAtOrDefault()Except()ExceptBy()First()FirstOrDefault()GroupBy()GroupBy(): element selectorGroupBy(): result selectorGroupJoin()Index()Intersect()IntersectBy()Join()Last()LastOrDefault()Max()Max(): exceptionsMaxBy()MaxBy(): exceptionsOfType()Order()OrderBy()OrderDescending()OrderByDescending()Prepend()Reverse()Select(): indexingSelectMany()SequenceEqual()Single()SingleOrDefault()Skip()SkipLast()SkipWhile()Sum()Take()TakeLast()TakeWhile()ThenBy()ThenByDescending()ToDictionary()ToLookup()TryGetNonEnumeratedCount()Union()UnionBy()Zip()
