Finally, I have finished another article about asynchronous programming. It develops the ideas of the previous one . Today we are going to discuss quite a difficult task that will reveal the power and flexibility of using coroutines in various nontrivial scenarios. At the end, we are going to consider two tasks on race-condition, and also a small bonus. By the way, the first article on asynchronous programming has become quite popular.
About two months ago I wrote an article about the analysis of GCC using PVS-Studio. The idea of the article was as follows: GCC warnings are great, but they’re not enough. It is necessary to use specialized tools for code analysis, for example, PVS-Studio. As proof of my words I showed errors that PVS-Studio was able to find the GCC code. A number of readers have noticed that the quality of the GCC code, and its diagnosis, aren’t really great; while Clang compiler is up to date, of high quality, and fresh.
My article will tell you how to accept 10 million packets per second without using such libraries as Netmap, PF_RING, DPDK and other. We are going to do this with Linux kernel version 3.16 and some code in C and C++. To begin with, I would like to say a few words on how pcap (a well-known method for packet capture) works. pcap is used in such popular utilities as iftop, tcpdump, arpwatch.
Since I’m going to provoke trolls on the subject of programming languages, and even name the best one in the world (I mean absolutely the best, for sure), I recommend all of them to check out my previous post “Choosing a Programming Language”. Everything mentioned there is still up-to-date, and I wouldn’t’ like to repeat myself here. Read it? Good. Today I am going to talk about the best programming language in the world, and I’ll name it closer to the end of this post.
Asynchronous programming… Hearing these words, programmers’ eyes begin to shine, breathing becomes shallow, hands are shaking and the brain is drawing multiple levels of abstraction… Managers’ eyes become wide, sounds become inarticulate, fists are clenched, and the voice switches to overtones. The only thing that unites these two groups of people is a rapid pulse. However, there are different reasons. While programmers are eager for the fight, managers are trying to look into the crystal ball and realize the risks, frantically trying to come up with reasons to extend the deadlines as mush as they can.
Not so long ago we worked on a diagnostic rule related to the finalizer check. This provoked an argument on the details of the garbage collector work and the finalization of objects. Although we have been programming in C# for more than 5 years, we haven’t achieved any consensus as regards this question, so I decided to study it more thoroughly. Introduction Usually .NET developers encounter a finalizer when they need to free an unmanaged resource.
This overview article is devoted to the study of a trend which is growing rapidly in popularity in the IT industry — chatbots, and the role of Microsoft in their development process. The article will cover the history of chatbots, peculiar properties of bots, the main, and also some unexpected spheres of their application, perspectives and technology limits. Generally, a chatbot is a program that can imitate a meaningful dialogue with the user via text or speech in the language known to the user.
Frankly speaking, I never faced the question of choosing a programming language. In other words, this choice has always been obvious for me. I never took part in holy wars like C++ vs. Java that used to be so popular at the end of 1990s. When you see a huge growth of productivity with your own eyes, any discussions become meaningless. I’ve also noticed that only people who’ve seen just one side of the given discussion usually take part in it.
I regularly check various open-source projects to demonstrate the abilities of the PVS-Studio static code analyzer (C, C++, C#). Now it is time for the GCC compiler to get checked. Unquestionably, GCC is a very qualitative and well-tested project, that’s why it’s already a great achievement for a tool to find any errors in it. Fortunately, PVS-Studio coped with this task. No one is immune to typos or carelessness. This is why the PVS-Studio can become an additional line of defense for you, on the front of the endless war against bugs.
When discussing static analysis tools for C# projects, programmers will often deny the necessity of static analysis arguing that most errors can be caught through unit testing. So, I decided to find out how well one of the most popular unit-testing frameworks, NUnit, was tested and see if our analyzer could find anything of interest there. Introduction NUnit is a popular unit-testing library for .NET projects ported from Java to C#.