Parallel Vs Concurrent Programming


When we talk about parallel programming, typically we are always interested in decreasing the execution time by taking the advantage of hardware’s ability to do more than one job at a time, whether by vectorization, instruction-level parallelism or by multiprocessing. Parallel programming does not implicit a particular programming model, and many techniques and languages for parallel programming are at various stages of development or adoption.

One model which seems to be promising is data parallelism, in which uniform operations over aggregate data can be sped up by dividing the data and computing into the partitions simultaneously. For instance, High-Performance Fortran offers parallel loops, where an operation such as adding up two arrays element-wise can be sped up by vectorizing a loop or splitting it between several processing units that handle different portions of the arrays simultaneously. Data Parallel Haskell, a research language, expands this model to allow parallelizing operations on ragged arrays of arrays. The best thing about data parallelism is that it’s usually deterministic and implicit— the user does not have to write a program that says “do these four things at the same time,” but rather say “do this to that whole array” and the compiler or run-time system works on how to partition things. The less admirable thing is that data parallelism usually only applies when the user has a big array that you want to treat more or less uniformly.

Another approach of parallelism is futures or fork/join parallelism, in which some computations whose value is not needed right away is started in parallel with the “main” computation, and then when the main computation needs the result of the side computation, it may have to wait till it is finished. An expression e could instead be written (FUTURE e), and it would mean the same thing, but might run in parallel until its value is actually needed. The other language that provides a similar model is Cilk, a C-like language that has a parallel procedure call mechanism that looks a lot similar to futures. Futures are often good when the user have a computation that can be broken into pieces whose values depend on each other in well-defined ways but aren’t necessarily uniform enough for data parallelism to work.


In concurrent programming, a program is typically factored into multiple threads of control with clear responsibilities and purposes, which may run simultaneously or take turns. This is often about dealing with concurrency and nondeterminism in the world, or about reducing latency. For instance, the user’s web browser needs to deal with events from the UI and events from the network while also performing some computation such as rendering a page. While it is possible to program as a single thread of control that checks for various events and does other computations, it’s often easier, conceptually, to think of it as several different processes cooperating on different aspects of the whole.

Most of the programming models for concurrency differ along two main axes: how processes are scheduled and how they cooperate. For the former, one end of the axis is pre-emptive multithreading, wherein several independent instruction streams run either simultaneously on different execution units or are given turns by a scheduler. This is the scheduling model used by Java and pthreads. At the other end are co-routines, which yield control to one other at well-defined points of the programmer’s choosing. This is the main idea behind Ruby’s fibers. Other models for scheduling include event loops with call-backs, as used by some GUI libraries, and stream transducers in data flow programming. One advantage of pre-emptive multithreading is that it can reduce latency, and it doesn’t require programmer effort to figure out when to transfer control, but a big disadvantage is that it can make the coordination more difficult.

Coordination—how multiple threads of control cooperate to get something done. Probably the most common model, and the hardest to use is shared memory with explicit synchronization. This is the model used by pthreads and, to some extent, Java. In this model, mutable objects may be shared by multiple threads running at the same time, which is a common source of bugs. Synchronization mechanisms such as locks can prevent interference, but they introduce problems of their own. Java improves on this model a bit with monitors, which make some synchronization less explicit, but it’s still pretty difficult to get right.

Because of the problems with shared-memory concurrency, two other models for concurrent communication have been achieving traction lately: transactional memory and message passing. In a transactional memory system, memory appears to be shared between threads, but it provides atomic transactions, whereby a thread may make several accesses to shared mutable variables and have guaranteed isolation. This has been implemented in software, originally in Concurrent Haskell, and latterly in other languages such as Clojure. In message-passing concurrency, threads no longer share mutable variables but communicate explicitly by sending messages. The poster language for message-passing concurrency is Erlang, and another language with a slightly different approach is Concurrent ML.


In this article all that we explained is the most modern programming languages support both concurrency and parallelism, through multiple paradigms. For instance, C#’s native model for concurrency is shared memory with synchronization, but there are libraries for both message passing and software transactional memory. In some sense, shared memory is the least-common-denominator on which other concurrency approaches and parallelism may be implemented. Many programs can benefit from both parallelism and concurrency. For example, the web browser may be able to speed up particular tasks, such as rendering, by parallelizing them, at the same time that it uses concurrency to deal with concurrency in the world.


Amazon Elasticsearch Features?

Amazon Elasticsearch Service (Amazon ES) is a managed service that makes it easy to create a domain, deploy, operate, and scale Elasticsearch clusters in the AWS Cloud.


Security with AWS Identity and Access Management (IAM) access control

Dedicated master nodes to improve cluster stability

Domain snapshots to back up and restore Amazon ES domains and replicate domains across Avail ability Zones
Data visualization using the Kibana tool

Integration with Amazon CloudWatch for monitoring Amazon ES domain metrics

Integration with AWS CloudTrail for auditing configuration API calls to Amazon ES domains


What are the advantages of Spring Boot?

  • Reduce Development, Testing time and efforts.
  • Use of JavaConfig helps avoid usage of XML.
  • Avoid lots of maven imports and the various version conflicts.
  • Provide Opinionated Development approach.
  • Quick start to development by providing defaults.
  • No Separate Web Server Needed.Which means that you no longer have to boot up Tomcat, Glassfish, or anything else.
  • Requires less configuration-Since there is no web.xml file. Simply add classes annotated with@Configuration and then you can add methods annotated with@Bean, and Spring will automagically load up the object and manage it like it always has. You can even add Autowired to the bean method to have Spring autowire in dependencies needed for the bean.


Explain Java 8-Internal vs. External Iteration?

External Iterators- This Iterator is also known as active iterator or explicit iterator. For this type of iterator the control over iteration of elements is with the programmer. Which means that the programmer define when and how the next element of iteration is called.

Internal Iterators- This Iterator is also known as passive iterator, implicit iterator or callback iterator. For this type of iterator the control over the iteration of elements lies with the iterator itself. The programmer only tells the iterator “What operation is to be performed on the elements of the collection”. Thus the programmer only declares what is to be done and does not manage and control how the iteration of individual elements take place.


What is the use of attributes- enabled, index, and store?

The enabled attribute applies to various ElasticSearch specific/created fields such as _index and _size. User-supplied fields do not have an “enabled” attribute.

Store means the data is stored by Lucene will return this data if asked. Stored fields are not necessarily searchable. By default, fields are not stored, but full source is. Since you want the defaults (which makes sense), simply do not set the store attribute.

The index attribute is used for searching. Only indexed fields can be searched. The reason for the differentiation is that indexed fields are transformed during analysis, so you cannot retrieve the original data if it is required.


Does ElasticSearch have a schema?

Yes, Elastic search can have a schema. A schema is a description of one or more fields that describes the document type and how to handle the different fields of a document. The schema in Elasticsearch is a mapping that describes the fields in the JSON documents along with their data type, as well as how they should be indexed in the Lucene indexes that lie under the hood. Because of this, in Elasticsearch terms, we usually call this schema a “mapping”.

Elasticsearch has the ability to be schema-less, which means that documents can be indexed without explicitly providing a schema. If you do not specify a mapping, Elasticsearch will by default generate one dynamically when detecting new fields in documents during indexing.


Is Artifactory well suited for C/C++ artifacts targeting Win, Linux and OS X platforms? E.g. .lib, .exe, .a, .so, .dll

Of course. Artifactory is well-suited for any binary file (i.e. not text), and .lib, .exe, .a, .so and .dll are all binaries. We don’t have a special type of repository for those files because the repository types are per indexing system; not per file type. It’s really about which tool you use to deploy and resolve those files. For example, if you use Gradle, you’ll need to a repository in Maven format, or if you just issue HTTP calls from your scripts, a Generic repo will be the best fit.


Docker Vs VMs

Docker vs Vms

Every application will have their own dependencies, which include both software and hardware resources. Docker containers bring plentiful of unknown tags compared to the existing technologies in use. Docker is an open platform for developers, it’s mechanism helps in isolating the dependencies per each application by packing them into containers. Containers are scalable and secure to use and deploy as compared to other previous approaches.

Virtual machines are used broadly in cloud computing. Isolation and resource control have continually been achieved through the use of virtual machines. Virtual machine loads a full OS with its own memory management and enables the applications to be more organized and secure while ensuring their high availability.

So let’s dive deep in and know the major differences between Docker and VMs and know how they might be useful to your resources. So let’s dive deep in and know the major differences between Docker and VMs and also how they might be useful to your resources.


Virtual machines contain a full OS with its own memory management installed with-in the associated overhead of virtual device drivers. In a virtual machine, valuable resources are duplicated for the guest OS and hypervisor, which makes it possible to run in many instances of one or more operating systems in parallel on a single machine. Every guest OS runs as an individual entity from the host system.

On the other hand, Docker containers are executed with the Docker engine rather than the hypervisor. Containers are smaller than Virtual Machines and enable faster startup with better performance, less isolation, and greater rapport is possible because of sharing the host’s kernel.


When it comes to the comparison, Docker Containers have much more potential than Virtual Machines. It is noticeable that Docker Containers are able to share a single kernel and shares the application libraries. Containers present in a lower system overhead than Virtual Machines and the performance of the application inside a container is generally same or better when compared to the same application running on a Virtual Machine.

There is one major key point where Docker Containers are frail than Virtual Machines, and that is “Isolation”. Intel’s VT-d and VT-x technologies have provided Virtual Machines with ring-1 hardware isolation of which, it takes full advantage. It helps the Virtual Machines from breaking down and in interfering with each other but Docker Containers do not have any hardware isolation.

Compared to virtual machines, containers can be bit faster as-long-as the user is willing to stick to a single platform to provide the shared operating system. A virtual machine takes more time to create and launch whereas a container can be created and launched within few seconds. Applications contained in containers offers versatile performance when compared to running the applications within a virtual machine.


Sometimes one can use a hybrid approach which makes use of both VM and Docker. There are also workloads which are well suited for physical hardware. If both are placed in a hybrid approach, it might lead to a better and well-organized scenario.

Below are a few of them, which explains how they work together as a Hybrid:

  • Docker Containers and Virtual Machines are not only sufficient to operate an application in production but also the user considers how are the Docker Containers going to run in an enterprise data center.
  • Application probability and enabling the accordant provisioning of the application across the infrastructure is provided by containers. But other operational requirements like security, performance, and other management tools and integrations are still a big challenge in front of Docker Containers.
  • Security isolation can be achieved by both Docker Containers and Virtual Machines.
  • Docker Containers can run inside a Virtual Machine though they are positioned as two separate technologies and provided them with advantages like proven isolation, security properties, mobility, software-defined storage, and massive ecosystem.


Using Docker or any other container solution in combination with a virtual machine is an option. By combining the two different technologies one can get the benefits of both technologies: The security of the virtual machine with the execution speed of containers.

Knowing the capabilities of the tools in the toolbox is the most important thing. There are a number of different things to keep in mind when doing that. However, in the case of containers Vs virtual machines, there is no one particular reason to choose just one. It can be a perfect world and you can choose both.


What is IoT?

What exactly is Internet of Things? It is an equivocal term, but it is becoming a tangible technology that can be applied to data centres to collect the information about anything that IT wants to control.

In simple term, The Internet of Things (IoT) is essentially a system of machines or objects outfitted with data-collecting technologies so that those objects can communicate with one another. The machine-to-machine data which is generated has a wide range of uses but is commonly seen as a way to determine the health and status of things.

Internet of Things is a new revolution of the Internet. Objects make themselves recognizable and they obtain intelligence by enabling context related decisions. They can access information that has been aggregated by other things, or they can be components of complex services. This transformation is associated with the emergence of cloud computing capabilities and the transition of the Internet towards IPv6 with an unlimited addressing capacity. The main goal of the Internet of Things is to enable the things to be connected anytime, anyplace, with anything and anyone using any path or network.

There is a diverse combinations of communication technologies, which need to be adapted in order to address the needs of IoT applications such as efficiency, speed, security, and reliability. In this context, it is possible that the level of diversity will be scaled to a number of manageable connectivity technologies that address the needs of the IoT applications. Standard IoT examples include wired and wireless technologies like Ethernet, WI-FI, Bluetooth, ZigBee, GSM, and GPRS.


The principal characteristics of the IoT are as follows:

Interconnectivity: With regard to the IoT, everything can be interconnected with
the global information and communication infrastructure.

Things-related services: The IoT is capable of providing things-related services within the constraints of things, such as privacy protection and semantic consistency between physical things and their associated virtual things. To provide things-related services within the constraints of things, both the technologies in physical world and information world will change.

Heterogeneity: The devices in the IoT are heterogeneous, based on different hardware platforms and networks. They can interact with other devices or service platforms through different type of networks.

Dynamic changes: The state of devices change dynamically, for instance sleeping and waking up, connected or disconnected as-well-as the context of devices including location and speed. Furthermore, the number of devices can change dynamically.

Enormous scale: The number of devices that need to be managed and that communicate with each other will be at least an order of magnitude larger than the devices connected to the current Internet. It is even more critical when the management of the data and their interpretation for application purposes are generated. This relates to semantics of data, as well as efficient data handling.

Safety: As we all gain benefits from the IoT, we should not forget about safety. Both the creators and recipients of the IoT, must design for safety. This includes the safety of our personal data and the safety of our physical well-being. Securing the endpoints, the networks, and the data moving across all of it means creating a security paradigm that will scale.


You might be surprised to learn how many things are connected to the Internet, and how much economic benefit we can derive from analyzing the resulting data streams. Below are some examples of the impact the IoT has on industries:

Intelligent transport solutions speed up traffic flows, reduces fuel consumption, and arranges vehicle repair schedules.

Smart electric grids more effectively connect with renewable resources and improve system reliability.Machine monitoring sensors determine and forecast the pending maintenance issues, near-term part stock outs, and schedule maintenance crew schedules for repair equipment and regional needs. Data-driven systems are built into the infrastructure of “smart cities,” making it easier for municipalities to run waste management, law enforcement, and other programs more systematically.


With the incessant boom of the emerging IoT technologies, the concept of Internet of Things will soon be inevitably developed on a very large scale. This emerging paradigm of networking will influence every part of our lives ranging from the automated houses to smart health and environment monitoring by implanting intelligence into the objects around us.

Internet of Things