ssh abhijit

279 posts

ssh abhijit banner
ssh abhijit

ssh abhijit

@waluigimg

Summer of bitcoin @SeedSigner | Specialist and Knight | Frequent ball watcher | NIT Allahabad '27

wherever Katılım Mart 2024
95 Takip Edilen20 Takipçiler
Sabitlenmiş Tweet
ssh abhijit
ssh abhijit@waluigimg·
If you wanna go read something interesting on bitcoin, blockchain or data structures, i shamelessly plug my medium. Heres an article that I'm proud of: @abhijitsaha1006/segment-trees-in-lightning-networks-e4eb77c0203a" target="_blank" rel="nofollow noopener">medium.com/@abhijitsaha10
English
0
0
0
717
ssh abhijit
ssh abhijit@waluigimg·
Football won today
English
0
0
0
8
ssh abhijit
ssh abhijit@waluigimg·
Going to do complete full striver sheet revision today or gay (all roads lead to striver)
English
0
0
1
17
ssh abhijit
ssh abhijit@waluigimg·
@0xansh_ Being someone in a similar program, I would suggest you take as many hardware based electives as you can as they for the most part won't be covered If you want to go into tech/sde that is
English
1
0
2
96
Ansh
Ansh@0xansh_·
It's official now!!!!!!😁 I'll be joining on the 20th. Seniors, any advice for a fresher would be greatly appreciated 🙏🙏.
Ansh tweet media
English
2
0
14
1.3K
ssh abhijit retweetledi
Chris Lakin
Chris Lakin@chrislakin·
what your risk-aversion costs you
Chris Lakin tweet media
English
128
470
6K
825.2K
ssh abhijit retweetledi
iraq obama
iraq obama@ducktelevision·
the hottest person you know can't see without their glasses
English
422
12.3K
100.8K
4.4M
ssh abhijit
ssh abhijit@waluigimg·
@VazeKshitij Yep that is the fix, I was talking about the naive way where L doesn't inherit the priority of its blocking processes
English
0
0
1
12
kshitij vaze
kshitij vaze@VazeKshitij·
@waluigimg no wait, it'll be L then H and then M. I confirmed this git gippity, and it seems to agree - L (Priority 1) ↓ M waits → L inherits 2 ↓ H waits → L inherits 3 ↓ L releases mutex ↓ H acquires mutex ↓ H releases mutex ↓ M acquires mutex
English
1
0
1
69
kshitij vaze
kshitij vaze@VazeKshitij·
So - Semaphores vs Mutexes are a nice debate to have. A semaphore can be thought of as simply a flag, which can be used by tasks in an OS to indicate if something is available or not. A mutex, is something that ensures that the resource that it is locking is also functionally protected and cannot be modified till the mutex is released. How so? Functionally, a semaphore consists of a count (typically 0 or 1) along with a list of tasks waiting to take the semaphore. When a task calls take(), the count is decremented if the semaphore is available; otherwise, the task is blocked until another context calls give(). It is kinda dumb, as it has no concept of who the hell called it first. If Task A successfully takes a semaphore, there is nothing preventing Task B from giving it back later if the application is designed that way. The RTOS doesn't consider this an error because semaphores are intended for synchronization and event signalling rather than ownership. This is exactly why they're commonly used for things like waking a task from an ISR after a DMA transfer or a CAN frame reception. You can see how this is an issue if we are using a semaphore to protect some resource, that is shared between tasks/threads like a piece of memory. In that case, a mutex is the way to go. A mutex, is implemented as a struct that includes the taskHandle of the task that is "taking" the mutex, and this changes the dynamics of locking and unlocking a mutex. When Task A successfully locks the mutex, it becomes the owner, and only Task A is permitted to unlock it. If another task attempts to release the mutex, the RTOS treats it as an invalid operation. And since we have identities of tasks now, we can control priorities now. If a high-priority task is blocking the CPU as it is waiting for a mutex held by a lower-priority task (and hence, it cannot run), the kernel can temporarily boost the priority of the mutex owner so it can finish its work and release the mutex sooner. This prevents priority inversion, something that simply isn't possible with a semaphore because there is no owner to boost. So while semaphores and mutexes are implemented similarly under the hood, their semantics are very different: -> Semaphore: Synchronization and event signalling. No ownership. Any context can give it. -> Mutex: Mutual exclusion. Ownership is enforced. Only the owning task can unlock it, enabling priority inheritance and making it suitable for protecting shared resources. That's how an RTOS helps protect critical stuff when dealing with multiple threads - which is kinda always, since if it was a single thread, you wouldn't need an RTOS in the first place!
English
10
5
97
2.6K
ssh abhijit
ssh abhijit@waluigimg·
@VazeKshitij What are the pros of keeping it baremetal, I'm guessing the con is that you are prone to run into all sorts of concurrency issues
English
0
0
1
5
kshitij vaze
kshitij vaze@VazeKshitij·
So. Wanna peek into the life of an embedded engineer? I have to work on a graphics codebase, via an Embedded graphics designer/library/a bunch of other things called TouchGFX. I kinda did a dumbass thing by not integrating it with FreeRTOS from the jump, and choosing to keep it baremetal. Why? I had a time constraint, and I didn't know enough about FreeRTOS to confidently use it. So, I initialised a timer, passed it's tick interrupt as a heartbeat event to the graphics engine, and called it a day. Now, I gotta design the UI. Generate the backend code. Develop graphics application and transitions on top of said backend. Create bindings for the UI's C++ code to be able to pass data to the microcontroller's C codebase, a.k.a. the firmware. Integrate user inputs via a joystick (whole new level of hell) AND via touch. And finally, pass the data via a CAN bus to the main system control MCU. And if this shit doesn't sound exhausting enough - this is the HMI for a vehicle, and the whole operation kinda depends on this little bastard working perfectly. So.....no pressure at all!!!
English
6
1
72
2K
divyansh
divyansh@Divyansh91565·
day summary until now: - lc potd (good problem) - 1x lc hard (maths + observations) - 1x lc hard (0/1 bfs) - 1x lc medium (dijkstra + dp) - should've been hard imo - 1x cf 1900 (multisource bfs + some tweaks) - really good problem - 1x spoj (dijkstra) - 1x cses (graph) -might give div-3 today also, not sure yet. but today's dsa/cp grind is done. now it's time for some python maxxing tonight after gym. gym today: chest + shoulders + triceps. lfg!!
divyansh tweet media
English
10
0
77
2.9K
ssh abhijit
ssh abhijit@waluigimg·
deceptively hard problem...at least I felt
ssh abhijit tweet media
English
0
0
0
20
neural nets.
neural nets.@cneuralnetwork·
WHAT THE FUCK WAS THAT NORWAY GOAL
English
4
0
54
2.9K
ssh abhijit
ssh abhijit@waluigimg·
@Divyansh91565 10 hrs was my peak when I had to lock in for my physics exam back in school days and I hadn't studied anything
English
1
0
1
46
divyansh
divyansh@Divyansh91565·
my longest sitting streak is 6 hrs without any break.. just me, a chair and my laptop. share yours.
English
40
0
137
5.2K
ssh abhijit
ssh abhijit@waluigimg·
Full cses graphs revision today or gay
English
0
0
0
12
ssh abhijit
ssh abhijit@waluigimg·
Full oops revision today or gay
English
0
0
0
12
ssh abhijit
ssh abhijit@waluigimg·
Not to say that you shouldn't consult others...but I believe u should only take consultation from the most trusted people, and if you can count them on more than one hand...I think you are too gullible
English
0
0
0
10
ssh abhijit
ssh abhijit@waluigimg·
People can't make simple decisions and overcomplicated shit, and I think the biggest reason is peer pressure I still think the decisions that I've taken in my life without much consultation from others have actually been pretty solid
English
1
0
0
11