Mira
735 subscribers
802 photos
25 videos
20 files
263 links
sporadic attempts at cybersec.
personal channel.

files: @mira_files
playlist: @the_coding_playlist
Download Telegram
sup y'all 🙌
🤝5👀1
app-arm64-v8a-release.apk
7.4 MB
this is the latest apk for it
❤2
had a human-contact outside of my family members today. such a milestone 😊🙌
😁3🔥2👀1
Go is a bit slower than compiled languages like C mostly due to its automated memory management also known as the "Go runtime". oftentimes this is for memory safety and simpler syntax.

#golang
*me proceeds to ask dad about our maid, and dad responds with "what maid?"
😁9👍1
I'm hoping a lot from Barca and Arsenal this year. both got a match today

fyi i've been a diehard fan of Barcelona since i was 6 or 7 😭
🔥3
Blessed are those who do not fear solitude, who are not afraid of their own company, who are not always desperately looking for something to do, something to amuse themselves with.


#quotes
❤1
lmao so true
🔥6
facts 💯
❤4💊1
Mira
Jesus Christ!
i can only imagine how many different cases are not still known and many parents have been mistreated in front of Justice.
Robi makes stuff
im in my listening more than talking era
this part of my life is called growing
❤3
😁2
started with a win 💙

#fcb
This media is not supported in your browser
VIEW IN TELEGRAM
Japanese version of scare tactics lmao 💀
🤣6
this got me lmao 😅

happy Sunday anyways 🙌
😁11
without a doubt 💯
😁6
Understanding the Go Runtime: A Deep Dive

So, the Go runtime is like the brains behind the Go programming language. It handles all the behind-the-scenes stuff, making sure everything runs smoothly, from managing memory to keeping all those little goroutines in line.

Let's break it down:

1. Goroutines: Think of them as mini-threads, super lightweight and totally awesome for concurrency. The runtime keeps track of all these goroutines and makes sure they all get their fair share of CPU time.

2. The Scheduler: It's like the air traffic controller of the Go runtime. It manages all those goroutines, deciding who gets to run and when, using a fancy technique called 'work-stealing'. This way, no goroutine gets stuck waiting around, and things keep moving along.

3. Garbage Collection: The clean-up crew! The Go runtime automatically handles memory, identifying and getting rid of memory that's no longer needed. It does this without slowing things down, using a technique called 'concurrent mark-and-sweep'. You don't have to worry about memory leaks – the runtime takes care of all the dirty work.

Use Cases

package main

import (
"fmt"
"time"
)

func sayHello() {
for i := 0; i < 5; i++ {
fmt.Println("Hello from goroutine!")
time.Sleep(100 * time.Millisecond)
}
}

func main() {
go sayHello() // Let's kick off a new goroutine

// Keep doing our thing in the main goroutine
for i := 0; i < 5; i++ {
fmt.Println("Hello from main!")
time.Sleep(150 * time.Millisecond)
}
}


In this example, sayHello is running concurrently with main. The runtime is managing the whole shebang, making sure both functions get their chance to run.

The Scheduler in Action

The Go scheduler uses a cool system called Proportional Fair Scheduling (PFS), giving each goroutine a fair shot at the CPU. It's always checking in on the goroutines, making sure everything is running smoothly and no one is getting stuck.

It also uses a concept called M, P, and G:

- M (Machine): These are the actual OS threads running your program.
- P (Processor): Think of them as virtual processors, managed by the scheduler.
- G (Goroutine): The mini-threads we talked about.

When you create a goroutine, it gets assigned to a processor, which manages its execution. Sometimes, a goroutine might need to pause, maybe to wait for some input or data. The runtime handles this gracefully, letting other goroutines take over while the paused one chills out.

Let's Wrap It Up

The Go runtime is a total powerhouse. It keeps your Go code running smoothly and efficiently, allowing you to build awesome concurrent applications without getting bogged down in low-level details.

#TakeAByte #GoRuntime #golang
@Mi_Ra_Ch
⚡4