<?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>DEV Community: saurabh chatterjee</title>
    <description>The latest articles on DEV Community by saurabh chatterjee (@chatter_14).</description>
    <link>https://dev.to/chatter_14</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%2F132183%2Fbe61dbae-201e-4845-a9c6-f0369eb10d8b.jpg</url>
      <title>DEV Community: saurabh chatterjee</title>
      <link>https://dev.to/chatter_14</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/chatter_14"/>
    <language>en</language>
    <item>
      <title>Fibers in Java (Yes fibers !!!)</title>
      <dc:creator>saurabh chatterjee</dc:creator>
      <pubDate>Sun, 27 Jan 2019 06:49:14 +0000</pubDate>
      <link>https://dev.to/chatter_14/fibers-in-java-yes-fibers--589j</link>
      <guid>https://dev.to/chatter_14/fibers-in-java-yes-fibers--589j</guid>
      <description>&lt;p&gt;Fiber is upcoming feature in Java which will offer a light weight alternative to Threads . However the question is why fibers ,one word answer to it is “money”.&lt;/p&gt;

&lt;p&gt;Each thread created by Java corresponds to operating system thread. Creating Threads is costly as well as context switching to another thread is quite expensive. As a result in most applications thread gets blocked and servers remain underutilized. Java fibers on the other hand will be managed by JVM by its own scheduler .&lt;/p&gt;

&lt;p&gt;If we see methods of Thread class vis-a-vis Fiber it will make the picture clearer.&lt;/p&gt;

&lt;p&gt;Thread :&lt;br&gt;
checkAccess() countStackFrames() getContextClassLoader() getId() getName() getPriority() getStackTrace() getState() getThreadGroup() getUncaughtExceptionHandler() interrupt() isAlive() isDaemon() isInterrupted() join() resume() run() setContextClassLoader() setDaemon() setName() setPriority() setUncaughtExceptionHandler() start() stop() suspend()&lt;/p&gt;

&lt;p&gt;Fiber :&lt;br&gt;
await() cancel() isAlive() isCancelled() schedule()&lt;/p&gt;

&lt;p&gt;Creating and starting a fiber is quite straight forward&lt;/p&gt;

&lt;p&gt;var fiber = new Fiber(() -&amp;gt; System.out.println("Hello from fiber"));&lt;br&gt;
fiber.schedule();&lt;/p&gt;

&lt;p&gt;In today’s cloud computing world where applications are billed on hourly basis reducing server underutilization is top most priority of application owners and fibers will certainly help them.&lt;/p&gt;

</description>
      <category>java</category>
    </item>
  </channel>
</rss>
