<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Professor Himtee</title>
    <description>The latest articles on Forem by Professor Himtee (@profhimtee).</description>
    <link>https://forem.com/profhimtee</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F396173%2F98244550-3786-4062-b877-50252649752e.jpg</url>
      <title>Forem: Professor Himtee</title>
      <link>https://forem.com/profhimtee</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/profhimtee"/>
    <language>en</language>
    <item>
      <title>How many level of memory do we need for fast processing?</title>
      <dc:creator>Professor Himtee</dc:creator>
      <pubDate>Sun, 28 Jun 2020 18:15:48 +0000</pubDate>
      <link>https://forem.com/profhimtee/how-many-level-of-memory-do-we-need-for-fast-processing-1ldg</link>
      <guid>https://forem.com/profhimtee/how-many-level-of-memory-do-we-need-for-fast-processing-1ldg</guid>
      <description>&lt;p&gt;We have heard several times that different levels of memory exists in our computer system. The different memories have different roles to play, it's basically for faster execution of the instruction.&lt;br&gt;
So, I want to understand how many levels of memory do we still need for the optimum performance of the processor, or is there any replacement for the existing computer architecture.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Please comment down your opinions.&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>computerarchitecture</category>
      <category>memoryhierarchy</category>
      <category>basics</category>
    </item>
    <item>
      <title>Feature toggle (change system behaviour during runtime)</title>
      <dc:creator>Professor Himtee</dc:creator>
      <pubDate>Sun, 21 Jun 2020 17:57:35 +0000</pubDate>
      <link>https://forem.com/profhimtee/feature-toggle-change-system-behaviour-during-runtime-1dg2</link>
      <guid>https://forem.com/profhimtee/feature-toggle-change-system-behaviour-during-runtime-1dg2</guid>
      <description>&lt;p&gt;Have you ever thought how the apps locks and unlocks the premium features and how and why only some users get the latest version of the apps? So, today we will see one of the technique called &lt;strong&gt;Feature toggle&lt;/strong&gt; which enable programmers to achieve all these automated system behaviour without changing anything in code once deployed.&lt;/p&gt;

&lt;p&gt;Let's started with term toggle, it is basically a condition which has the capability to enable or disable the logic which is inside that condition. And &lt;strong&gt;feature toggling&lt;/strong&gt; is the technique of creating such toggles which helps in changing the behaviour of application dynamically.&lt;/p&gt;

&lt;p&gt;It can be categorized into four different parts : &lt;strong&gt;Release, Experiment, Ops and Premission.&lt;/strong&gt;&lt;br&gt;
There are two important factors which determines the behaviour of toggles and they are &lt;strong&gt;dynamism and longevity&lt;/strong&gt;. Dynamism is how frequently that toggle will comes into execution part of the code, and later is the lifetime of that toggle. &lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--gXcJCaQJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/xn37ecopq79267wby3wg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--gXcJCaQJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/xn37ecopq79267wby3wg.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now we will try to understand the use-case of four toggles mentioned above.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Release toggle :&lt;/strong&gt; This toggle generally used when you have incomplete code or untested code which is a part of the release cycle. The lifetime of this toggle is short because the fix or change(if any) will be a part of next release cycle which is due soon.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Experiment toggle :&lt;/strong&gt; This toggle is used to test the new feature on any application. You have heard multiple times that some feature is available for specific users only. This is done just for realtime validation of the feature and can be achieved using experiment toggle.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Ops toggle :&lt;/strong&gt; This comes into play when you have to disable any specific functionalties of the platform. They are very much similar to &lt;strong&gt;circuit beakers&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Permission toggle :&lt;/strong&gt; You have seen the use-case of this toggle in every paid applications. This enables application to hide the premium feature for non-premium and make available for premium users.&lt;/p&gt;

&lt;p&gt;To read more about feature toggle refer &lt;a href="https://martinfowler.com/articles/feature-toggles.html#ATogglingTale"&gt;this.&lt;/a&gt;&lt;/p&gt;

</description>
      <category>featuretoggle</category>
      <category>coding</category>
      <category>systemcontrol</category>
      <category>automation</category>
    </item>
    <item>
      <title>volatile vs const in cpp</title>
      <dc:creator>Professor Himtee</dc:creator>
      <pubDate>Sat, 13 Jun 2020 19:53:33 +0000</pubDate>
      <link>https://forem.com/profhimtee/volatile-vs-const-in-cpp-16k</link>
      <guid>https://forem.com/profhimtee/volatile-vs-const-in-cpp-16k</guid>
      <description>&lt;p&gt;&lt;strong&gt;volatile&lt;/strong&gt; and &lt;strong&gt;const&lt;/strong&gt; keywords are very confusing from there implementation perspective. Today we will see the basic fundamental difference between the two.&lt;br&gt;
&lt;strong&gt;const&lt;/strong&gt; is pretty straight forward, we will declare a variable &lt;strong&gt;const&lt;/strong&gt; if the value of the variable is not changing during the runtime of the program. It helps in fast execution of the program as compiler caches the value in the cache memory of the CPU.&lt;br&gt;
&lt;strong&gt;Eg:&lt;br&gt;
void foo()&lt;br&gt;
{&lt;br&gt;
const int a = 100;&lt;br&gt;
}&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;Whereas the purpose of &lt;strong&gt;volatile&lt;/strong&gt; is different, when you declare any variable with &lt;strong&gt;volatile&lt;/strong&gt; keyword compiler will not perform any kind of optimization for that variable. The optimization is not done because the value for that variable may change by some external factors which compiler can't detect at runtime.&lt;br&gt;
&lt;strong&gt;Eg:&lt;br&gt;
void foo()&lt;br&gt;
{&lt;br&gt;
 volatile int a = 100;&lt;br&gt;
 while(a)&lt;br&gt;
 {&lt;br&gt;
  //operation&lt;br&gt;
 }&lt;br&gt;
}&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;In the above example the execution condition of the while loop is constant, if the value of &lt;strong&gt;a&lt;/strong&gt; is not changing inside the loop. Then compiler will try to optimize this conditional statement inorder to minimize the data fetching overhead for the CPU. It will try to replace the above code with something like below.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;void foo()&lt;br&gt;
{&lt;br&gt;
 volatile int a = 100;&lt;br&gt;
 while(1)&lt;br&gt;
 {&lt;br&gt;
  //code&lt;br&gt;
 }&lt;br&gt;
}&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;But imagine the senario when the value of &lt;strong&gt;a&lt;/strong&gt; is getting changed by some external factors like threading, hardware register of the CPU or by some other means. Then it will end up on giving us some garbage value or even leads to crashing of the program.&lt;br&gt;
So, it's always advisable to use volatile very carefully.&lt;/p&gt;

&lt;p&gt;To read more about volatile keyword refer this,&lt;br&gt;
&lt;a href="https://en.wikipedia.org/wiki/Volatile_(computer_programming)"&gt;https://en.wikipedia.org/wiki/Volatile_(computer_programming)&lt;/a&gt;&lt;/p&gt;

</description>
      <category>cpp</category>
      <category>coding</category>
    </item>
  </channel>
</rss>
