<?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 Ashish tiwari on Medium]]></title>
        <description><![CDATA[Stories by Ashish tiwari on Medium]]></description>
        <link>https://medium.com/@abhitiwari9857?source=rss-bcd41e4edd7a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*UJ3HgVMw8Gipv_aEFcoRRA.jpeg</url>
            <title>Stories by Ashish tiwari on Medium</title>
            <link>https://medium.com/@abhitiwari9857?source=rss-bcd41e4edd7a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 22 May 2026 18:19:36 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@abhitiwari9857/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[Great! Here’s a Medium-style blog post on Rust Multithreading — clean, readable, and informative…]]></title>
            <link>https://medium.com/@abhitiwari9857/great-heres-a-medium-style-blog-post-on-rust-multithreading-clean-readable-and-informative-4732ac78b7fc?source=rss-bcd41e4edd7a------2</link>
            <guid isPermaLink="false">https://medium.com/p/4732ac78b7fc</guid>
            <category><![CDATA[rust]]></category>
            <category><![CDATA[multithreading]]></category>
            <dc:creator><![CDATA[Ashish tiwari]]></dc:creator>
            <pubDate>Sat, 23 Aug 2025 00:59:50 GMT</pubDate>
            <atom:updated>2025-08-23T00:59:50.248Z</atom:updated>
            <content:encoded><![CDATA[<h3>Great! Here’s a <strong>Medium-style blog post</strong> on <strong>Rust Multithreading</strong> — clean, readable, and informative for devs of all levels</h3><h3>Getting Started with Multithreading in Rust: Safe Concurrency Made Practical</h3><blockquote>“Fearless concurrency” — that’s not just a marketing tagline. In Rust, it’s a reality.</blockquote><p>In today’s multi-core world, multithreading is no longer a luxury — it’s a necessity. If you’re working in performance-critical systems, games, or backend services, being able to write safe, efficient concurrent code is key.</p><p>Rust, with its unique ownership system, brings <strong>thread safety at compile time</strong> — a dream come true for developers tired of race conditions and undefined behaviors in C++ or even Java.</p><p>In this article, let’s walk through the basics of multithreading in Rust — from spawning threads to message passing and shared state, the <em>Rusty</em> way.</p><h3>Spawning Threads</h3><p>Rust makes it easy to spawn threads using the std::thread module:</p><pre>use std::thread;</pre><pre>fn main() {<br>    let handle = thread::spawn(|| {<br>        for i in 1..5 {<br>            println!(&quot;From thread: {}&quot;, i);<br>        }<br>    });</pre><pre>    for i in 1..5 {<br>        println!(&quot;From main: {}&quot;, i);<br>    }</pre><pre>    handle.join().unwrap(); // Wait for thread to finish<br>}</pre><h3>Output (unordered):</h3><pre>From main: 1<br>From thread: 1<br>From main: 2<br>From thread: 2<br>...</pre><p>Rust ensures you don’t accidentally leave a thread hanging. join() blocks until the thread finishes.</p><h3>Ownership &amp; Safety</h3><p>Rust’s compiler prevents you from doing unsafe things like moving references into threads that may outlive the scope:</p><pre>rustfn main() {<br>    let name = String::from(&quot;Rustacean&quot;);</pre><pre>    let handle = thread::spawn(move || {<br>        println!(&quot;Hello, {}&quot;, name);<br>    });</pre><pre>    handle.join().unwrap();<br>}</pre><ul><li>move is required because name is owned by the main thread.</li><li>Rust moves ownership into the closure, ensuring no dangling reference occurs.</li></ul><h3>Message Passing with Channels</h3><p>Rust encourages <strong>message passing over shared memory</strong>, similar to Go. You can use channels to communicate safely between threads.</p><pre>use std::sync::mpsc;<br>use std::thread;<br>use std::time::Duration;</pre><pre>fn main() {<br>    let (tx, rx) = mpsc::channel();</pre><pre>    thread::spawn(move || {<br>        let val = String::from(&quot;hello&quot;);<br>        tx.send(val).unwrap();<br>    });</pre><pre>    let received = rx.recv().unwrap();<br>    println!(&quot;Got: {}&quot;, received);<br>}</pre><ul><li>mpsc stands for <strong>multiple producer, single consumer</strong>.</li><li>You can clone the sender (tx.clone()) to send from multiple threads.</li></ul><h3>Shared State with Mutex &amp; Arc</h3><p>When you do need shared memory, Rust gives you Mutex and Arc — a safe abstraction for shared mutable state.</p><pre>use std::sync::{Arc, Mutex};<br>use std::thread;</pre><pre>fn main() {<br>    let counter = Arc::new(Mutex::new(0));<br>    let mut handles = vec![];</pre><pre>    for _ in 0..10 {<br>        let counter = Arc::clone(&amp;counter);<br>        let handle = thread::spawn(move || {<br>            let mut num = counter.lock().unwrap();<br>            *num += 1;<br>        });<br>        handles.push(handle);<br>    }</pre><pre>    for handle in handles {<br>        handle.join().unwrap();<br>    }</pre><pre>    println!(&quot;Result: {}&quot;, *counter.lock().unwrap());<br>}</pre><ul><li>Arc (Atomic Reference Counted) is like Rc but thread-safe.</li><li>Mutex ensures mutual exclusion — only one thread can access the value at a time.</li></ul><h3>What About Performance?</h3><p>Rust’s zero-cost abstractions mean you get <strong>thread safety without runtime penalties</strong>. No garbage collector, no thread contention surprises — just deterministic performance you can trust.</p><p>For heavier concurrent workloads, consider:</p><ul><li>rayon for data-parallelism</li><li>tokio for async I/O and tasks</li><li>crossbeam for advanced channels and memory management</li></ul><h3>🧠 Final Thoughts</h3><p>Multithreading is hard — but Rust makes it <strong><em>safe by design</em></strong>.</p><ul><li>No more race conditions sneaking into production</li><li>Compiler as your concurrency guardian</li><li>Expressive, performant, and fearless</li></ul><p>Whether you’re building game engines or high-performance APIs, Rust’s multithreading support is robust enough to scale, and safe enough to trust.</p><p><em>Thanks for reading! If you’re diving into Rust, don’t forget to check out crates like </em><em>rayon, </em><em>tokio, or </em><em>crossbeam. And remember: safe concurrency is not a myth — Rust just made it real.</em></p><p>Would you like me to add images, diagrams, or convert this into a markdown file for upload to Medium?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4732ac78b7fc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From Confusion to Creation: My Journey Integrating Wallets in a Solana React App]]></title>
            <link>https://medium.com/@abhitiwari9857/from-confusion-to-creation-my-journey-integrating-wallets-in-a-solana-react-app-b0adf9ff01e4?source=rss-bcd41e4edd7a------2</link>
            <guid isPermaLink="false">https://medium.com/p/b0adf9ff01e4</guid>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[solana-blockchain]]></category>
            <dc:creator><![CDATA[Ashish tiwari]]></dc:creator>
            <pubDate>Sun, 13 Jul 2025 04:40:11 GMT</pubDate>
            <atom:updated>2025-07-13T04:40:11.274Z</atom:updated>
            <content:encoded><![CDATA[<p>There I was, staring at my screen.</p><p>Blank App.jsx.<br> A half-empty Figma design.<br> And the thought: <em>“Where do I even start with wallet integration on Solana?”</em></p><h3>🧭 Enter: The Solana Wallet Adapter</h3><p>After hours of Googling and Discord scrolling, I stumbled upon something magical:<br> <a href="https://github.com/solana-labs/wallet-adapter">@solana/wallet-adapter</a>.</p><p>It promised what every dev wants:</p><blockquote><em>Plug and play wallet integration for React — with support for Phantom, Solflare, Backpack, and more.”</em></blockquote><h3>🏗️ The Setup Begins…</h3><p>I followed the docs (okay, <em>skimmed</em> the docs) and wired up my App.jsx like this:</p><pre>&lt;ConnectionProvider endpoint={endpoint}&gt;<br>  &lt;WalletProvider wallets={wallets} autoConnect&gt;<br>    &lt;WalletModalProvider&gt;<br>      &lt;WalletMultiButton /&gt;<br>      &lt;TokenLaunchpad /&gt;<br>    &lt;/WalletModalProvider&gt;<br>  &lt;/WalletProvider&gt;<br>&lt;/ConnectionProvider&gt;</pre><p>It looked simple. But… <em>what the heck does all this mean?</em></p><p>I needed to <strong>understand</strong>, not just copy-paste.</p><p>So I sat down with a hot chai and broke it down line by line.</p><h3>🧠 What I Learned — The Hard Way</h3><h3>🔌 1. ConnectionProvider</h3><blockquote>“Bro, without a connection to the Solana blockchain, nothing moves.”</blockquote><p>This provider creates a connection to the cluster I chose — in my case, devnet.<br> It made sure my React components could interact with the blockchain.</p><h3>👛 2. WalletProvider</h3><blockquote>“This is like the security gate. You define who gets in.”</blockquote><p>I passed PhantomWalletAdapter() to it — my favorite wallet.<br> This provider handles wallet connection state, auto-connect, and signing.</p><h3>💬 3. WalletModalProvider</h3><blockquote>“Popups are annoying — until someone else builds them for you.”</blockquote><p>This one gives the slick popup UI you get when clicking “Connect Wallet”.<br> No need to build your own modal from scratch. Yes, please!</p><h3>🧲 4. WalletMultiButton</h3><blockquote>“The magic button that does it all.”</blockquote><p>I dropped this into my JSX and boom — a connect button appeared with Phantom support. It even showed my wallet address after connecting.</p><h3>🔥 5. TokenLaunchpad</h3><blockquote>“This is where I shine.”</blockquote><p>This was my own custom component.<br> Inside it, I used useWallet() to access the connected wallet and create a new SPL Token.</p><p>const wallet = useWallet();</p><p>if (!wallet.publicKey || !wallet.signTransaction) {<br> alert(“Wallet not connected”);<br> return;<br>}</p><h3>🪄 And Suddenly… It All Clicked</h3><p>I wasn’t just copying boilerplate anymore.</p><p>I understood:</p><ul><li>Why each provider existed</li><li>How the button worked</li><li>What the wallet hook returned</li><li>How React, Solana, and Web3 worked together like gears in a clock</li></ul><p>This wasn’t just code.<br> This was a <strong>gateway to building dApps, launching tokens, and creating the future.</strong></p><h3>🌠 What I’d Tell Any New Developer</h3><p>If you’re starting out with Solana, don’t be scared by all the wrappers and providers.</p><p>Start with this flow</p><pre>ConnectionProvider<br>  → WalletProvider<br>    → WalletModalProvider<br>      → WalletMultiButton<br>      → YourComponent (with useWallet())</pre><p>This structure may look intimidating at first, but it’s <strong>powerful</strong>.<br> It handles:</p><ul><li>Blockchain connection</li><li>Wallet detection</li><li>Connect/disconnect flows</li><li>Transaction signing</li></ul><p>So that <strong>you</strong> can focus on building.</p><h3>📸 Visual Summary</h3><p><em>(Tip: You can draw this using draw.io or use Undraw illustrations)</em></p><pre>[User]<br>   |<br>[WalletMultiButton] ← UI Button<br>   |<br>[WalletModalProvider] ← Shows popup<br>   |<br>[WalletProvider] ← Holds Phantom etc.<br>   |<br>[ConnectionProvider] ← Talks to Solana Devnet</pre><p>solana, web3, react, wallet-integration, spl-token, blockchain-development, dapp, phantom-wallet</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q2wJR5xTsXMH35T-OT8LFg.jpeg" /></figure><p>Git — <a href="https://github.com/StrTux/token-launchpad.git">https://github.com/StrTux/token-launchpad.git</a></p><p>x — <a href="https://x.com/StrTux">https://x.com/StrTux</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b0adf9ff01e4" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>