<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Mushroom hunter on Medium]]></title>
        <description><![CDATA[Stories by Mushroom hunter on Medium]]></description>
        <link>https://medium.com/@akankshadokania?source=rss-f28df06c8034------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ip7B2dABq6CkdMOMxEtKqA.jpeg</url>
            <title>Stories by Mushroom hunter on Medium</title>
            <link>https://medium.com/@akankshadokania?source=rss-f28df06c8034------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 22:21:18 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@akankshadokania/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[The Rain, the Chorus, and the Silent Trogon]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-snippet">If you&#x2019;ve been birding in the Western Ghats, you&#x2019;ve almost certainly come across a mixed-species flock. You may not have known the term&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/@akankshadokania/the-rain-the-chorus-and-the-silent-trogon-0bc707f7de03?source=rss-f28df06c8034------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@akankshadokania/the-rain-the-chorus-and-the-silent-trogon-0bc707f7de03?source=rss-f28df06c8034------2</link>
            <guid isPermaLink="false">https://medium.com/p/0bc707f7de03</guid>
            <dc:creator><![CDATA[Mushroom hunter]]></dc:creator>
            <pubDate>Sat, 04 Jul 2026 14:57:04 GMT</pubDate>
            <atom:updated>2026-07-04T14:57:04.227Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[School chale hum]]></title>
            <link>https://medium.com/@akankshadokania/school-chale-hum-c6d045949c24?source=rss-f28df06c8034------2</link>
            <guid isPermaLink="false">https://medium.com/p/c6d045949c24</guid>
            <category><![CDATA[schools]]></category>
            <category><![CDATA[learning]]></category>
            <category><![CDATA[education]]></category>
            <category><![CDATA[education-reform]]></category>
            <dc:creator><![CDATA[Mushroom hunter]]></dc:creator>
            <pubDate>Sun, 03 May 2020 12:12:53 GMT</pubDate>
            <atom:updated>2020-05-11T10:15:21.468Z</atom:updated>
            <content:encoded><![CDATA[<h3>A sneak peek into the schools</h3><p>The lockdown imposed all over the world has forced schools, colleges, and other educational institutions to conduct virtual or online classes and students can listen to these classes sitting at home. I wonder why we needed a pandemic to realize that it is very much feasible to hold remote classes with the help of existing technologies. It’s not that these online classes didn’t exist at all pre-pandemic days, but schools and colleges were too reluctant to shift to digital platforms. The old conventional method of education was followed almost everywhere in every part of the country. There is no denying that more and more schools and colleges are constructed throughout the country, enabling more and more students to have access to these learning institutions. From outside, the data look convincing enough to indicate a rise in the number of students enrolled in schools and an increase in literacy rate. It certainly makes us feel good when we see this surge across villages, towns, and cities, implying a rise in awareness among people. It gives us the idea that people have started to value education more than earlier, making an effort to enroll their children in schools and colleges and that’s the most primitive step towards the development of a country. But what bothers me is that these educational institutions or learning platforms have not changed their methods of providing education. They continue to follow the old traditional medium to facilitate learning. If you look inside these schools and the colleges and try to understand the methods used to facilitate learning, your heart will certainly sink. These institutions are hollow from inside. Rather than creating an environment conducive for learning, these institutions focus more on doing things that make them look good on paper. They have not taken the efforts to advance with the world and have failed to incorporate the innovations happening everywhere. And, nonetheless, if this is the stance of the educators, administrators, it’s difficult to imagine how they can create an ecosystem to teach students to keep up with the world.</p><p>I want to start from the basics and want to focus on schools in this article. Most of the parents enroll their children in schools at the age of 3–4 years. We, parents, have the belief that schools will help our children to grow, learn, and develop cognitive skills. We spend a hefty amount of money in our kids’ education and ready to let schools consume six to seven hours of our children every day. We assume that sending our kids to school is the only effective way to educate them and the assumption is so strong that we force our children to go to schools even if they dislike it. We tend to easily agree with schools’ rules and regulations and try our best to conform to them. Here, I would like to focus on the methods adopted by schools to foster learning and discuss how they may not be as good as we think them to be:</p><p>School always groups children according to their age group. It puts all children of the same age group in one class and exposes them to the same learning environment without considering their interests and their knowledge level. The underlying idea behind this kind of grouping assumes that all children start to learn at the same age and their learning curve is equal. This assumption is flawed as human beings are individual beings. Another undesired effect of this policy is that it invariably ingrains the thought in our brains that friendship can only be sought among people of similar age groups. This prevents us from the companionship of elders whose sea of experiences can be a great source of knowledge, and also from sharing the candor of toddlers whose different views on life can give new insights.</p><p>Schools teach subjects. It divides topics into sub-topics and congregates them into various subjects. If I am interested in a topic, that doesn’t mean that I will be interested in the subject in entirety. And, this concept to divide everything into subjects gets ingrained in us since childhood. Given any task to handle, our first instinct is to categorize it into a subject. This prevents us from seeing the broader picture. It doesn’t allow us to inter-relate things which might be different and hence, doesn’t enable learning to the full capacity.</p><p>Schools don’t allow us to choose subjects of our interest until we reach grade nine. It is expected out of us to learn each subject passionately and get good grades in each of them. With the amount of time we have in their lifetime, it is nearly impossible to learn anything and everything. Schools asking students to focus on each subject equally and get good grades in each of them is insane. This is problematic in two ways: first, this is stealing the time from students which they could have utilized in learning their favorite topics. Secondly, by forcing them to develop an interest in a subject, they are not, it is also reducing their inclination towards learning.</p><p>Learning cannot be forced on a person. It is natural, it comes from within, and the topic of interest may vary from a person to person, and from time to time. It is imprudent for school authorities to predetermine the topics to be taught on a particular day and their durations. It may so happen that a particular subject is trending all over the world and students may be more interested in learning about the trending topic than the textbooks forced upon them. It should be up to them to decide what would be the topic of learning for that day and what will be the mode of learning.</p><p>Schools want us to follow a timetable, where we are supposed to switch context from one subject to another in 45 mins or an hour. To be frank, it takes time to understand, develop interest, and deep dive into a subject. Before interest and fascination kick in, bells ring in to remind students to stop their current activities and switch to a completely unrelated topic.</p><p>The profession of teaching is not that well paid and not respected across the world (except a few counties like Finland). Except for a few people who are passionate about teaching, it mostly happens that people who are left with no choice in their career get into this profession. Needless to say, these people don’t have the right knowledge, attitude, and enthusiasm to pique children’s curiosity. Moreover, School compels teachers to focus more on organization, rules, and regulations than teaching. I would not lie if I say that ego also plays a role here. Every teacher wants children to comply with the school rules and regulations and maintain order in their class.</p><p>Schools conduct examinations. The idea of exams encourages competition over collaboration. It is the time when we should encourage students to come together, discuss ideas, and build something concrete and not compete against each other. The competitions, the desire to be always ahead of others also prevent students from forming strong bonds.</p><p>Chinese people believe in the philosophy of Ying and Yang. Give and Absorb. They believe that there should a balance between what you give to the people around and what you take from them. The school environment, which necessarily means sitting in a classroom for six hours facing front towards the teacher and not talking to anybody, disturbs this balance. School rules do not allow children to work in groups, have deep conversations, and even share their opinions. It forces children to only absorb things without giving out anything. It also discourages children from forming their own opinions as they are never heard. Needless to mention, school eats away so much time of their lives that they hardly can spend their time in anything else like spending more time outside with nature.</p><p>I don’t have definitive answers or alternatives for what we can do to improve the schools. Various brilliant ideas have chipped in like flipped classrooms and homeschooling and are being implemented in various places. Right now, what I think is important, is to start pondering over these points and start questioning do schools need to be this bad? Does a student need to go through so much trouble to learn? I strongly feel that it’s high time that we look beyond conventional/traditional schools and start to reform our policies to make school easy, enjoyable, and edifying for students.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c6d045949c24" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Golang?]]></title>
            <link>https://medium.com/@akankshadokania/why-golang-6b1f1c957dbd?source=rss-f28df06c8034------2</link>
            <guid isPermaLink="false">https://medium.com/p/6b1f1c957dbd</guid>
            <category><![CDATA[programming-languages]]></category>
            <category><![CDATA[golang]]></category>
            <category><![CDATA[channel]]></category>
            <category><![CDATA[goroutines]]></category>
            <category><![CDATA[concurrency]]></category>
            <dc:creator><![CDATA[Mushroom hunter]]></dc:creator>
            <pubDate>Sat, 01 Dec 2018 18:49:17 GMT</pubDate>
            <atom:updated>2019-10-23T06:41:30.824Z</atom:updated>
            <content:encoded><![CDATA[<h3>Understanding goroutines and channels</h3><p>I have been often asked by my friends that what makes Golang better than other programming languages. Why is it said that Golang handles concurrency and parallelism better than others? In order to understand that, we need to delve into two very important concepts in Golang.</p><ol><li>Goroutines</li><li>Channels</li></ol><p>Goroutines are user-space threads, created and managed by go runtime, which can execute tasks independently and potentially in parallel. These “user-space threads” are different from OS threads that other programming languages utilize to solve concurrency and parallelism. Goroutines are lightweight in nature and are less expensive with respect to resources. For example, a goroutine’s initial stack size is 8K and can grow as per the requirement. These goroutines are multiplexed onto OS threads (M : N model) by the runtime scheduler.</p><p>Channels can be thought of as pipes or conduits using which goroutines communicate. Values can be sent into a channel from one goroutine and received by another goroutine. The arrow mark indicates the direction of the flow of data. Channels are of two types: buffered and non-buffered. This nature of the channel depends on how it is initialized. Let us deep dive into what happens inside the hood when a channel is initialized and how goroutines are managed by runtime scheduler.</p><p>Let us initialize a channel of type integers and of buffer size 5.</p><p><strong>ch := make(chan int, 5)</strong></p><p>Under the hood, what Golang does is this: It allocates a type <em>hchan</em> struct, which consists of a <em>buffer</em> (a circular queue data structure), <em>sendx</em>, <em>recvx</em>, a <em>lock</em>, and other fields, initializes it and returns a pointer to it. So, ch under the hood is simply a pointer pointing to this <em>hchan</em> struct. We can pass it “by value” between functions and modify the underlying buffer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/549/1*zYt9VMhH20b7ciq1jav-SA.png" /><figcaption>hchan struct</figcaption></figure><p><em>sendx </em>and <em>recvx </em>are set according to data being queued into and dequeued from the buffer. Initially, both are set to 0 and the queue is empty. The working of a circular queue is shown in the diagram below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*laDi_W6Do9bxjSe1whQCKQ.png" /><figcaption>Working of a circular queue</figcaption></figure><p>When the buffer is full, <em>sendx</em> and <em>recvx </em>are again set to 0.</p><p><strong>How data is sent/received to/from the same channel by multiple goroutines?</strong></p><p>In order to understand that, let us assume that we are running the following program. <strong>ch</strong> is the channel used by two goroutines. The main runs in goroutine G1</p><pre><strong>func </strong>main() {<br>   …<br>   <strong>for </strong>_, number := <strong>range </strong>numbers {<br>      ch &lt;- number<br>   }<br>   …<br>}</pre><p>and worker in goroutine G2</p><pre><strong>func </strong>Worker() {<br>   <strong>for </strong>{<br>      number := &lt;- ch<br>      process(number)<br>   }<br>}</pre><p><strong>Let us suppose that G1 comes first and sends a number, say 1, to the channel. It does so by</strong></p><p>a. Acquiring the lock of channel ch</p><p>b. Enqueueing the data(in this case integer 1) into the buffer(sendx set to 1 and recvx remains at 0) -&gt; this is memory copy of data</p><p>c. Releasing the lock</p><p><strong>Similarly, when G2 receives from the channel, it does so by</strong></p><p>a. Acquiring the lock of channel ch</p><p>b. Dequeueing the data from the buffer(recvx incrmented by 1 and sendx remains as it is) -&gt; this is also memory copy of data into variable number</p><p>c. Releasing the lock</p><p>So, both the goroutines do not share anything except the channel ch (protected by the lock). The variables these goroutines receive or send to the channel are copies.</p><p>One may ask, what would happen when the buffer is full? For example, G1 has sent 5 numbers to the channel and wants to send 6th number. G2 has not received any number from the channel yet.</p><p><strong>G1’s execution is paused and it is resumed after G2 receives a number.</strong></p><p><strong>Question 1: Who pauses the execution of G1 and how it is done?</strong></p><p>Remember<strong> go runtime scheduler</strong>?</p><p>Go runtime scheduler multiplexes goroutines onto OS threads. <strong>How</strong>?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KpelOCN3bQ9NvMIEPHVwRQ.png" /></figure><p>For simplification, let us consider that only one OS thread M is running. Every OS thread (M) holds onto a context (P) which in turn holds runqueue (list of scheduled goroutines to be executed)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*agRmHgzqJdTnGyEU6dLYeg.png" /><figcaption>Current state of the system</figcaption></figure><pre>ch &lt;- number6</pre><p>G1 is running on OS thread M. It has sent 5 numbers to the channel and is willing to send 6th number. G2’s execution has not started yet, so it is in runqueue. Buffer size is full and G1 knows that it cannot further enqueue any number into the buffer.</p><p>G1 calls runtime scheduler for help (makes a gopark call).</p><p>Scheduler sets G1 into waiting state, breaks off the association between G1 and M,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8HLsvqoOmLWtSJWDhoSUjw.png" /><figcaption>G1 set to waiting state</figcaption></figure><p>pops off another scheduled goroutine(let us say G2) from runqueue and sets it into running state.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fmiTF0RcmnEc_jSfKkyFQA.png" /><figcaption>G2 set to running state</figcaption></figure><p>Now, G1 is set to waiting state, it is blocked, but OS thread M is still in execution and runs goroutine G2. This is one of the advantages of using goroutines as go minimizes creating/managing OS threads.</p><p><strong>Question 2. Who resumes G1?</strong></p><p>Before, G1 calls on the runtime scheduler, it stores its state of resumption. <em>hchan </em>struct(the channel) has fields <em>sendq</em> and <em>recvq</em> represented by <em>sudog</em> struct. <em>sudog</em> struct contains a pointer to the waiting goroutine and a pointer to the data element it is waiting on to send or receive.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qZsYJeoOkLVLiac8U381iA.png" /><figcaption>sendq and recvq in hchan struct</figcaption></figure><p>In our case, <em>sendq</em> would be populated by G1 and would look like this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EBijbgyZOfODIEPqftQa8w.png" /></figure><p>When G2 receives from the channel</p><pre>number := &lt;- ch</pre><p>it dequeues number 1 from the buffer, pops up the waiting <em>sendq</em>, enqueues number 6 into the buffer and calls on the runtime scheduler(goready call) to set G1 to runnable. One thing to notice is that G2 itself enqueues number 6 into the buffer as it is already available in the <em>sudog</em> struct. This is done for optimization i.e. to avoid a few memory copies and acquiring/releasing of the lock.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o4Zn6OId8c8FB7Wf_l9GSw.png" /></figure><p>G1 is now in the runqueue and hence, it will be executed by the scheduler at some time. Hopefully, by now, on a high level, it is clear how multiple goroutines send and receive data across the same channel and how context switching takes place between different goroutines.</p><p>For all those eager to explore more about channels and goroutines:</p><p><strong>Can you come up with the flow when goroutine G2 runs first?</strong></p><p>This blog is inspired from the talk “GopherCon 2017 - Understanding Channels” given by Kavya Joshi. I was amazed by the simplicity and lucidity with which she had explained channels and goroutines and, hence, wanted to pen it down to revisit my thoughts. Link to the talk:</p><p><a href="https://www.youtube.com/watch?v=KBZlN0izeiY">https://www.youtube.com/watch?v=KBZlN0izeiY</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6b1f1c957dbd" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>