This part describes a feature which was introduced in v.5.5.19: an ability to send mutable messages with guarantees that it will be delivered to at most one receiver.
This is the next part of the serie of presentations with deep introduction into features of SObjectizer-5.5.
This part is dedicated to such important feature as cooperations.
Dive into SObjectizer 5.5. Seventh part: Message LimitsYauheni Akhotnikau
Next part of serie with deep dive into SObjectizer-5.5. A brief explanation of message limits feature. This feature allows to protect agents from overloading in simple situations and can be used as building blocks for more complex and domain-specific overload control schemes.
This is the next part of the serie of presentations with deep introduction into features of SObjectizer-5.5.
This part is dedicated to such important feature as cooperations.
Dive into SObjectizer 5.5. Seventh part: Message LimitsYauheni Akhotnikau
Next part of serie with deep dive into SObjectizer-5.5. A brief explanation of message limits feature. This feature allows to protect agents from overloading in simple situations and can be used as building blocks for more complex and domain-specific overload control schemes.
arataga. SObjectizer and RESTinio in action: a real-world exampleYauheni Akhotnikau
Slides about the usage of SObjectizer and RESTinio in implementation of performant socks5/http1.1 proxy server that has to deal with thousands of entry points.
Date Processing Attracts Bugs or 77 Defects in Qt 6Andrey Karpov
The recent Qt 6 release compelled us to recheck the framework with PVS-Studio. In this article, we reviewed various interesting errors we found, for example, those related to processing dates. The errors we discovered prove that developers can greatly benefit from regularly checking their projects with tools like PVS-Studio.
Miranda NG Project to Get the "Wild Pointers" Award (Part 1) Andrey Karpov
I have recently got to the Miranda NG project and checked it with the PVS-Studio code analyzer. And I'm afraid this is the worst project in regard to memory and pointers handling issues I've ever seen. Although I didn't study the analysis results too thoroughly, there still were so many errors that I had to split the material into 2 articles. The first of them is devoted to pointers and the second to all the rest stuff. Enjoy reading and don't forget your popcorn.
Presentation derived from the "What's new in Python 2.6" document on http://www.python.org/ including much reformatting for presenting and presenter notes.
Please download the Keynote original - that way the presentation notes aren't burned into the slides.
The Chromium browser is developing very fast. When we checked the solution for the first time in 2011, it included 473 projects. Now it includes 1169 projects. We were curious to know if Google developers had managed to keep the highest quality of their code with Chromium developing at such a fast rate. Well, they had.
Testing RESTful Webservices using the REST-assured frameworkMicha Kops
The REST-assured framework and its features explained by example.
For detailed information please take a look at my full tutorial including the sources at http://www.hascode.com/2011/10/testing-restful-web-services-made-easy-using-the-rest-assured-framework/
Still Comparing "this" Pointer to Null?Andrey Karpov
This is a translation of an article written by Dmitry Meshcheryakov, an ABBYY employee and first published here: "ABBYY blog. Still Comparing "this" Pointer to Null?". Translation done and published with permission of the copyright holder.
Java has a solid Memory Model, and there are a couple of excellent libraries for concurrency. When you start working with threads however, pitfalls start appearing - especially if the program is supposed to be fast and correct. This session shows proven solutions for some typical problems, showing how to view program code from a concurrency perspective: Which threads share which data, and how? How to reduce the impact of locks? How to avoid them altogether - and when is that worth it?
One of the Microsoft development teams already uses PVS-Studio analyzer in their work. It's great, but it's not enough. That's why I keep demonstrating how static code analysis could benefit developers, using Microsoft projects as examples. We scanned Casablanca project three years ago and found nothing. As a tribute to its high quality, the project was awarded with a "bugless code" medal. As time went by, Casablanca developed and grew. PVS-Studio's capabilities, too, have significantly improved, and now I've finally got the opportunity to write an article about errors found by the analyzer in Casablanca project (C++ REST SDK). These errors are few, but the fact that their number is still big enough for me to make this article, does speak a lot in favor of PVS-Studio's effectiveness.
Every now and then, we have to write articles about how we've checked another fresh version of some compiler. That's not really much fun. However, as practice shows, if we stop doing that for a while, folks start doubting whether PVS-Studio is worth its title of a good catcher of bugs and vulnerabilities. What if the new compiler can do that too? Sure, compilers evolve, but so does PVS-Studio – and it proves, again and again, its ability to catch bugs even in high-quality projects such as compilers.
C# is an elegant and type-safe object-oriented language that enables developers to build a variety of secure and robust applications that run on the .NET Framework. You can use C# to create Windows client applications, XML Web services, distributed components, client-server applications, database applications, and much, much more. Visual C# provides an advanced code editor, convenient user interface designers, integrated debugger, and many other tools to make it easier to develop applications based on the C# language and the .NET Framework.
Learn C#.Net in simplified way.
ReactOS is intensively developing, and its codebase is steadily growing in size. On February 16, 2016, a new version of the operating system was released, and we thought it was a good occasion to run it through our static analyzer one more time. The new scan was done with PVS-Studio, version 6.02.
arataga. SObjectizer and RESTinio in action: a real-world exampleYauheni Akhotnikau
Slides about the usage of SObjectizer and RESTinio in implementation of performant socks5/http1.1 proxy server that has to deal with thousands of entry points.
Date Processing Attracts Bugs or 77 Defects in Qt 6Andrey Karpov
The recent Qt 6 release compelled us to recheck the framework with PVS-Studio. In this article, we reviewed various interesting errors we found, for example, those related to processing dates. The errors we discovered prove that developers can greatly benefit from regularly checking their projects with tools like PVS-Studio.
Miranda NG Project to Get the "Wild Pointers" Award (Part 1) Andrey Karpov
I have recently got to the Miranda NG project and checked it with the PVS-Studio code analyzer. And I'm afraid this is the worst project in regard to memory and pointers handling issues I've ever seen. Although I didn't study the analysis results too thoroughly, there still were so many errors that I had to split the material into 2 articles. The first of them is devoted to pointers and the second to all the rest stuff. Enjoy reading and don't forget your popcorn.
Presentation derived from the "What's new in Python 2.6" document on http://www.python.org/ including much reformatting for presenting and presenter notes.
Please download the Keynote original - that way the presentation notes aren't burned into the slides.
The Chromium browser is developing very fast. When we checked the solution for the first time in 2011, it included 473 projects. Now it includes 1169 projects. We were curious to know if Google developers had managed to keep the highest quality of their code with Chromium developing at such a fast rate. Well, they had.
Testing RESTful Webservices using the REST-assured frameworkMicha Kops
The REST-assured framework and its features explained by example.
For detailed information please take a look at my full tutorial including the sources at http://www.hascode.com/2011/10/testing-restful-web-services-made-easy-using-the-rest-assured-framework/
Still Comparing "this" Pointer to Null?Andrey Karpov
This is a translation of an article written by Dmitry Meshcheryakov, an ABBYY employee and first published here: "ABBYY blog. Still Comparing "this" Pointer to Null?". Translation done and published with permission of the copyright holder.
Java has a solid Memory Model, and there are a couple of excellent libraries for concurrency. When you start working with threads however, pitfalls start appearing - especially if the program is supposed to be fast and correct. This session shows proven solutions for some typical problems, showing how to view program code from a concurrency perspective: Which threads share which data, and how? How to reduce the impact of locks? How to avoid them altogether - and when is that worth it?
One of the Microsoft development teams already uses PVS-Studio analyzer in their work. It's great, but it's not enough. That's why I keep demonstrating how static code analysis could benefit developers, using Microsoft projects as examples. We scanned Casablanca project three years ago and found nothing. As a tribute to its high quality, the project was awarded with a "bugless code" medal. As time went by, Casablanca developed and grew. PVS-Studio's capabilities, too, have significantly improved, and now I've finally got the opportunity to write an article about errors found by the analyzer in Casablanca project (C++ REST SDK). These errors are few, but the fact that their number is still big enough for me to make this article, does speak a lot in favor of PVS-Studio's effectiveness.
Every now and then, we have to write articles about how we've checked another fresh version of some compiler. That's not really much fun. However, as practice shows, if we stop doing that for a while, folks start doubting whether PVS-Studio is worth its title of a good catcher of bugs and vulnerabilities. What if the new compiler can do that too? Sure, compilers evolve, but so does PVS-Studio – and it proves, again and again, its ability to catch bugs even in high-quality projects such as compilers.
C# is an elegant and type-safe object-oriented language that enables developers to build a variety of secure and robust applications that run on the .NET Framework. You can use C# to create Windows client applications, XML Web services, distributed components, client-server applications, database applications, and much, much more. Visual C# provides an advanced code editor, convenient user interface designers, integrated debugger, and many other tools to make it easier to develop applications based on the C# language and the .NET Framework.
Learn C#.Net in simplified way.
ReactOS is intensively developing, and its codebase is steadily growing in size. On February 16, 2016, a new version of the operating system was released, and we thought it was a good occasion to run it through our static analyzer one more time. The new scan was done with PVS-Studio, version 6.02.
Consequences of using the Copy-Paste method in C++ programming and how to dea...Andrey Karpov
I create the PVS-Studio analyzer detecting errors in source code of C/C++/C++0x software. So I have to review a large amount of source code of various applications where we detected suspicious code fragments with the help of PVS-Studio. I have collected a lot of examples demonstrating that an error occurred because of copying and modifying a code fragment. Of course, it has been known for a long time that using Copy-Paste in programming is a bad thing. But let's try to investigate this problem closely instead of limiting ourselves to just saying "do not copy the code".
Writing NodeJS applications is an easy task for JavaScript developers. However, getting what is happening under the hood in NodeJS may be intimidating, but understanding it is vital for web developers.
Indeed, when you try to learn NodeJS, most tutorials are about the NodeJS ecosystem like Express, Socket.IO, PassportJS. It is really rare to see some tutorials about the NodeJS runtime itself.
By this meetup, I want to spot the light on some advanced NodeJS topics so as to help developers answering questions an experienced NodeJS developer is expected to answer. Understanding these topics is essential to make you a much more desirable developer. I want to explore several topics including the famous event-loop along with NodeJS Module Patterns and how dependencies actually work in NodeJS.
I hope that this meetup would help you to be more comfortable understanding advanced code written in NodeJS.
Slowly the power of mysqlnd plugins become visible. Mysqlnd plugins challenge MySQL Proxy and are often a noteworthy, if not superior, alternative alternative to MySQL Proxy for PHP users. Plugins can do almost anything that MySQL Proxy can do - but on the client. Please find details in the slides. The presentation has been given today at the PHP track on FrOSCon.
Basic Functionality's in Typescript for Beginner's
Typescript vs Javascript
Typescript let vs var
Typescript Data Types
Typescript Variable Declaration
TypeScript operators
TypeScript control statements
TypeScript Switch Statement
TypeScript for loop
TypeScript for in loop
TypeScript while loop
TypeScript do while loop
Typescript function
Typescript function overloading
TypeScript number object
TypeScript string object
TypeScript boolean object
TypeScript date object
TypeScript math object
TypeScript array object
TypeScript tuples
TypeScript union type
TypeScript interface
TypeScript interface inheritance
TypeScript class
TypeScript abstract class
TypeScript object
TypeScript duck typing
TypeScript NameSpace
TypeScript module
TypeScript ambient module
Every single developer heard this say more than one time during his professional career, 'KIS' which means 'Keep It Simple', however with the excessive evolvement of the web computing and the continues rise of the distributed systems, the complexity of the systems architecture increases. Building a server enterprise application which is highly scalable with high and reliable availability in addition to great performance which consists of set of independent deployable oriented services can be achieved by Microservice architecture. This session introduces briefly what is the Microservice Architecture and how to build it using one of the most popular server programming languages which is called Go or Golang.
Czym się różnie JMS od AMQP? Co to jest queue? Co to jest topic? Jak zlecać zadania w przyszłości używając kolejek? Jak się do tego podpiąć z Javy? Na te i inne pytania postaram się odpowiedzieć na mojej prezentacji.
Actor Model and C++: what, why and how? (March 2020 Edition)Yauheni Akhotnikau
This is an updated version of slides from my talk on the C++ CoreHard Autumn 2016 conference.
The Actor Model which is currently trending in software development is a popular design approach when it comes to complex applications. Many systems are written in Erlang (Akka framework) are designed with the Actor Model in their core. But Erlang and Akka are managed environments and safe programming languages. Is it worth using the Actor Model in C++? If yes, where to look and what to use? The talk will cover all these topics.
Слайды одноименного доклада с конференции C++ CoreHard Autumn 2018 (г.Минск, 2018.11.03).
Краткое описание доклада:
На предыдущих конференциях C++ CoreHard автор доклада рассказывал про Модель Акторов и опыт ее использования в C++. Но Модель Акторов -- это далеко не единственный способ борьбы со сложностью при работе с многопоточностью. Давайте попробуем поговорить о том, что еще можно применить и как это может выглядеть в C++.
Shrimp: A Rather Practical Example Of Application Development With RESTinio a...Yauheni Akhotnikau
Description of a demo project for serving images by using Actor Model and embedded HTTP-server. This project is implemented in C++17 with SObjectizer and RESTinio (OpenSource products from stiffstream).
Акторы в C++: взгляд старого практикующего актородела (St. Petersburg C++ Use...Yauheni Akhotnikau
Автор доклада более 16 лет отвечает за развитие Open-Source фреймворка SObjectizer -- одного из немногих живых, эволюционирующих, кросс-платформенных фреймворков для C++, базирующихся на Модели Акторов. При этом SObjectizer никогда не был исследовательским экспериментом и с самого начала использовался в ряде business-critical проектов.
За годы разработки и эксплуатации SObjectizer накопился некоторый практический опыт использования акторов в С++, которым докладчик поделится со слушателями. Речь пойдет о том, почему Модель Акторов выглядит привлекательной, где и когда ее выгодно использовать. Какие особенности накладывает именно С++ и разумно ли использовать Модель Акторов в C++? Почему реализации Модели Акторов для C++ настолько разные и почему SObjectizer получился именно таким?
Слайды одноименного доклада с конференции "C++ Russia 2018". В докладе речь идет о том, насколько C++ мешает и насколько C++ помогает в разработке акторного фреймворка для C++.
GECon 2017: C++ - a Monster that no one likes but that will outlast them allYauheni Akhotnikau
Slides from my presentation from GECon-2017 conference: https://events.epam.com/events/gecon-2017
It covers the following topics:
A bit of C++ evolution history.
Why C++ became popular and why C++ started to lose its popularity.
Why C++ is a Monster? If C ++ is a monster, then why does someone need C++?
How to use C++ safely and efficiently?
Where and when C++ can be used. If it can...
Pressure to C++ from competitors. Real and imaginary.
Actor model which is currently trending in software development is a popular design approach when it comes to complex applications. Many systems written in Erlang (Akka framework) are designed with actor model in their core. But Erlang and Akka are managed environments and safe programming languages. Is it worth using actor model in C++? If yes, where to look and what to use? The talk will cover all these topics.
Слайды доклада на конференции C++ Corehard Winter 2017 (г.Минск).
Автор доклада давно и успешно использует Модель Акторов при разработке приложений на C++. В основном это был положительный опыт. Но есть некоторые неочевидные моменты, про которые было бы хорошо узнать заранее. О том, где использование Модели Акторов уместно, а где нет, на какие грабли довелось наступить, какие шишки были набиты, как можно упростить себе жизнь и пойдет речь в докладе.
E-commerce Application Development Company.pdfHornet Dynamics
Your business can reach new heights with our assistance as we design solutions that are specifically appropriate for your goals and vision. Our eCommerce application solutions can digitally coordinate all retail operations processes to meet the demands of the marketplace while maintaining business continuity.
Mobile App Development Company In Noida | Drona InfotechDrona Infotech
Looking for a reliable mobile app development company in Noida? Look no further than Drona Infotech. We specialize in creating customized apps for your business needs.
Visit Us For : https://www.dronainfotech.com/mobile-application-development/
AI Genie Review: World’s First Open AI WordPress Website CreatorGoogle
AI Genie Review: World’s First Open AI WordPress Website Creator
👉👉 Click Here To Get More Info 👇👇
https://sumonreview.com/ai-genie-review
AI Genie Review: Key Features
✅Creates Limitless Real-Time Unique Content, auto-publishing Posts, Pages & Images directly from Chat GPT & Open AI on WordPress in any Niche
✅First & Only Google Bard Approved Software That Publishes 100% Original, SEO Friendly Content using Open AI
✅Publish Automated Posts and Pages using AI Genie directly on Your website
✅50 DFY Websites Included Without Adding Any Images, Content Or Doing Anything Yourself
✅Integrated Chat GPT Bot gives Instant Answers on Your Website to Visitors
✅Just Enter the title, and your Content for Pages and Posts will be ready on your website
✅Automatically insert visually appealing images into posts based on keywords and titles.
✅Choose the temperature of the content and control its randomness.
✅Control the length of the content to be generated.
✅Never Worry About Paying Huge Money Monthly To Top Content Creation Platforms
✅100% Easy-to-Use, Newbie-Friendly Technology
✅30-Days Money-Back Guarantee
See My Other Reviews Article:
(1) TubeTrivia AI Review: https://sumonreview.com/tubetrivia-ai-review
(2) SocioWave Review: https://sumonreview.com/sociowave-review
(3) AI Partner & Profit Review: https://sumonreview.com/ai-partner-profit-review
(4) AI Ebook Suite Review: https://sumonreview.com/ai-ebook-suite-review
#AIGenieApp #AIGenieBonus #AIGenieBonuses #AIGenieDemo #AIGenieDownload #AIGenieLegit #AIGenieLiveDemo #AIGenieOTO #AIGeniePreview #AIGenieReview #AIGenieReviewandBonus #AIGenieScamorLegit #AIGenieSoftware #AIGenieUpgrades #AIGenieUpsells #HowDoesAlGenie #HowtoBuyAIGenie #HowtoMakeMoneywithAIGenie #MakeMoneyOnline #MakeMoneywithAIGenie
Quarkus Hidden and Forbidden ExtensionsMax Andersen
Quarkus has a vast extension ecosystem and is known for its subsonic and subatomic feature set. Some of these features are not as well known, and some extensions are less talked about, but that does not make them less interesting - quite the opposite.
Come join this talk to see some tips and tricks for using Quarkus and some of the lesser known features, extensions and development techniques.
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Mind IT Systems
Healthcare providers often struggle with the complexities of chronic conditions and remote patient monitoring, as each patient requires personalized care and ongoing monitoring. Off-the-shelf solutions may not meet these diverse needs, leading to inefficiencies and gaps in care. It’s here, custom healthcare software offers a tailored solution, ensuring improved care and effectiveness.
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxrickgrimesss22
Discover the essential features to incorporate in your Winzo clone app to boost business growth, enhance user engagement, and drive revenue. Learn how to create a compelling gaming experience that stands out in the competitive market.
Software Engineering, Software Consulting, Tech Lead, Spring Boot, Spring Cloud, Spring Core, Spring JDBC, Spring Transaction, Spring MVC, OpenShift Cloud Platform, Kafka, REST, SOAP, LLD & HLD.
Navigating the Metaverse: A Journey into Virtual Evolution"Donna Lenk
Join us for an exploration of the Metaverse's evolution, where innovation meets imagination. Discover new dimensions of virtual events, engage with thought-provoking discussions, and witness the transformative power of digital realms."
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Łukasz Chruściel
No one wants their application to drag like a car stuck in the slow lane! Yet it’s all too common to encounter bumpy, pothole-filled solutions that slow the speed of any application. Symfony apps are not an exception.
In this talk, I will take you for a spin around the performance racetrack. We’ll explore common pitfalls - those hidden potholes on your application that can cause unexpected slowdowns. Learn how to spot these performance bumps early, and more importantly, how to navigate around them to keep your application running at top speed.
We will focus in particular on tuning your engine at the application level, making the right adjustments to ensure that your system responds like a well-oiled, high-performance race car.
Transform Your Communication with Cloud-Based IVR SolutionsTheSMSPoint
Discover the power of Cloud-Based IVR Solutions to streamline communication processes. Embrace scalability and cost-efficiency while enhancing customer experiences with features like automated call routing and voice recognition. Accessible from anywhere, these solutions integrate seamlessly with existing systems, providing real-time analytics for continuous improvement. Revolutionize your communication strategy today with Cloud-Based IVR Solutions. Learn more at: https://thesmspoint.com/channel/cloud-telephony
GraphSummit Paris - The art of the possible with Graph TechnologyNeo4j
Sudhir Hasbe, Chief Product Officer, Neo4j
Join us as we explore breakthrough innovations enabled by interconnected data and AI. Discover firsthand how organizations use relationships in data to uncover contextual insights and solve our most pressing challenges – from optimizing supply chains, detecting fraud, and improving customer experiences to accelerating drug discoveries.
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeAftab Hussain
Understanding variable roles in code has been found to be helpful by students
in learning programming -- could variable roles help deep neural models in
performing coding tasks? We do an exploratory study.
- These are slides of the talk given at InteNSE'23: The 1st International Workshop on Interpretability and Robustness in Neural Software Engineering, co-located with the 45th International Conference on Software Engineering, ICSE 2023, Melbourne Australia
May Marketo Masterclass, London MUG May 22 2024.pdfAdele Miller
Can't make Adobe Summit in Vegas? No sweat because the EMEA Marketo Engage Champions are coming to London to share their Summit sessions, insights and more!
This is a MUG with a twist you don't want to miss.
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppGoogle
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
👉👉 Click Here To Get More Info 👇👇
https://sumonreview.com/ai-fusion-buddy-review
AI Fusion Buddy Review: Key Features
✅Create Stunning AI App Suite Fully Powered By Google's Latest AI technology, Gemini
✅Use Gemini to Build high-converting Converting Sales Video Scripts, ad copies, Trending Articles, blogs, etc.100% unique!
✅Create Ultra-HD graphics with a single keyword or phrase that commands 10x eyeballs!
✅Fully automated AI articles bulk generation!
✅Auto-post or schedule stunning AI content across all your accounts at once—WordPress, Facebook, LinkedIn, Blogger, and more.
✅With one keyword or URL, generate complete websites, landing pages, and more…
✅Automatically create & sell AI content, graphics, websites, landing pages, & all that gets you paid non-stop 24*7.
✅Pre-built High-Converting 100+ website Templates and 2000+ graphic templates logos, banners, and thumbnail images in Trending Niches.
✅Say goodbye to wasting time logging into multiple Chat GPT & AI Apps once & for all!
✅Save over $5000 per year and kick out dependency on third parties completely!
✅Brand New App: Not available anywhere else!
✅ Beginner-friendly!
✅ZERO upfront cost or any extra expenses
✅Risk-Free: 30-Day Money-Back Guarantee!
✅Commercial License included!
See My Other Reviews Article:
(1) AI Genie Review: https://sumonreview.com/ai-genie-review
(2) SocioWave Review: https://sumonreview.com/sociowave-review
(3) AI Partner & Profit Review: https://sumonreview.com/ai-partner-profit-review
(4) AI Ebook Suite Review: https://sumonreview.com/ai-ebook-suite-review
#AIFusionBuddyReview,
#AIFusionBuddyFeatures,
#AIFusionBuddyPricing,
#AIFusionBuddyProsandCons,
#AIFusionBuddyTutorial,
#AIFusionBuddyUserExperience
#AIFusionBuddyforBeginners,
#AIFusionBuddyBenefits,
#AIFusionBuddyComparison,
#AIFusionBuddyInstallation,
#AIFusionBuddyRefundPolicy,
#AIFusionBuddyDemo,
#AIFusionBuddyMaintenanceFees,
#AIFusionBuddyNewbieFriendly,
#WhatIsAIFusionBuddy?,
#HowDoesAIFusionBuddyWorks
Utilocate offers a comprehensive solution for locate ticket management by automating and streamlining the entire process. By integrating with Geospatial Information Systems (GIS), it provides accurate mapping and visualization of utility locations, enhancing decision-making and reducing the risk of errors. The system's advanced data analytics tools help identify trends, predict potential issues, and optimize resource allocation, making the locate ticket management process smarter and more efficient. Additionally, automated ticket management ensures consistency and reduces human error, while real-time notifications keep all relevant personnel informed and ready to respond promptly.
The system's ability to streamline workflows and automate ticket routing significantly reduces the time taken to process each ticket, making the process faster and more efficient. Mobile access allows field technicians to update ticket information on the go, ensuring that the latest information is always available and accelerating the locate process. Overall, Utilocate not only enhances the efficiency and accuracy of locate ticket management but also improves safety by minimizing the risk of utility damage through precise and timely locates.
2. This is the next part of the series of presentations with deep
introduction into features of SObjectizer-5.5.
This part is dedicated to mutable messages.
The feature is very young.
It was introduced in v.5.5.19.
SObjectizer Team, May 2017
4. Since the very beginning there were only immutable
messages in SObjectizer-5.
Immutable message is a very simple and safe approach to
implement an interaction in a concurrent application:
● a message instance can be received by any number of
receivers at the same time;
● a message can be redirected to any number of new
receivers;
● a message can be stored to be processed later...
SObjectizer Team, May 2017
5. Because of that immutable messages are very useful in 1:N
or N:M interactions.
And because Publish-Subscribe Model was the first model
supported by SObjectizer-5 the interaction via immutable
messages is used by default.
But there can be cases when immutable message is not a
good choice in 1:1 interaction...
SObjectizer Team, May 2017
7. Let's consider a pipeline of agents which need to modify a
big binary object...
A message like this:
struct raw_image_fragment final : public so_5::message_t {
std::array<std::uint8_t, 10*1024*1024> raw_data_;
...
};
That need to be processed by a pipeline like that...
SObjectizer Team, May 2017
8. An imaginary pipeline of agents which need to modify the
message:
class first_modificator final : public so_5::agent_t {
void on_fragment(mhood_t<raw_image_fragment> cmd) {
... // Some modification of cmd's contents.
next_stage_->deliver_message(cmd.make_reference()); // Send to the next.
}
...
};
class second_modificator final : public so_5::agent_t {
void on_fragment(mhood_t<raw_image_fragment> cmd) {
... // Some modification of cmd's contents.
next_stage_->deliver_message(cmd.make_reference()); // Send to the next.
}
...
};
SObjectizer Team, May 2017
9. But... It won't be compiled!
class first_modificator final : public so_5::agent_t {
void on_fragment(mhood_t<raw_image_fragment> cmd) {
cmd->raw_data_[0] = ...; // WON'T COMPILE! cmd->raw_data_ is const!
...
next_stage_->deliver_message(cmd.make_reference()); // Send to the next.
}
...
};
class second_modificator final : public so_5::agent_t {
void on_fragment(mhood_t<raw_image_fragment> cmd) {
cmd->raw_data_[1] = ...; // WON'T COMPILE! cmd->raw_data_ is const!
...
next_stage_->deliver_message(cmd.make_reference()); // Send to the next.
}
...
};
SObjectizer Team, May 2017
10. A safe way is copy, modify and send modified copy...
class first_modificator final : public so_5::agent_t {
void on_fragment(mhood_t<raw_image_fragment> cmd) {
auto cp = std::make_unique<raw_image_fragment>(*cmd);
cp->raw_data_[0] = ...;
...
next_stage_->deliver_message(std::move(cp)); // Send to the next.
}
...
};
class second_modificator final : public so_5::agent_t {
void on_fragment(mhood_t<raw_image_fragment> cmd) {
auto cp = std::make_unique<raw_image_fragment>(*cmd);
cp->raw_data_[1] = ...;
...
next_stage_->deliver_message(std::move(cp)); // Send to the next.
}
...
};
SObjectizer Team, May 2017
11. It's obvious that the safe way is a very, very inefficient...
SObjectizer Team, May 2017
13. Let's consider a case where agent Alice opens a file and
then transfers opened file to agent Bob:
struct process_file final : public so_5::message_t { // A message to transfer opened file.
std::ifstream file_;
process_file(std::ifstream file) : file_(std::move(file)) {}
};
class Alice final : public so_5::agent_t {
...
void on_handle_file(mhood_t<start_file_processing> cmd) {
std::ifstream file(cmd->file_name()); // Try to open...
if(file) so_5::send<process_file>(bob_mbox, std::move(file)); // Transfer file to Bob.
}
};
class Bob final : public so_5::agent_t {
...
void on_process_file(mhood_t<process_file> cmd) {
... // Some file processing code.
}
};
SObjectizer Team, May 2017
14. But if we try to do something like that:
class Bob final : public so_5::agent_t {
...
void on_process_file(mhood_t<process_file> cmd) {
std::ifstream file(std::move(cmd->file_)); // (1)
... // Processing file content.
}
};
We will get a compile-time error at point (1) because
cmd->file_ is const and can't be moved anywhere...
SObjectizer Team, May 2017
15. There Are Some Workarounds Of Course...
SObjectizer Team, May 2017
16. You can declare fields of your messages as mutable:
struct raw_image_fragment final : public so_5::message_t {
mutable std::array<std::uint8_t, 10*1024*1024> raw_data_;
...
};
class first_modificator final : public so_5::agent_t {
void on_fragment(mhood_t<raw_image_fragment> cmd) {
cmd->raw_data_[0] = ...; // Now it works.
...
next_stage_->deliver_message(cmd.make_reference()); // Send to the next.
}
...
};
But what if your message is received by two agents at the
same time? There is no any guarantee that message will be
delivered only to the single receiver...
SObjectizer Team, May 2017
17. Or you can use shared_ptr instead of object itself:
struct process_file final : public so_5::message_t { // A message to transfer opened file.
std::shared_ptr<std::ifstream> file_;
process_file(std::shared_ptr<std::ifstream> file) : file_(std::move(file)) {}
};
class Alice final : public so_5::agent_t {
...
void on_handle_file(mhood_t<start_file_processing> cmd) {
auto file = std::make_shared<std::ifstream>(cmd->file_name()); // Try to open...
if(*file) so_5::send<process_file>(bob_mbox, std::move(file)); // Transfer file to Bob.
}
};
But there is additional memory allocation and additional level
of data indirection. Overhead can be significant if you need
to transfer small objects like mutexes.
SObjectizer Team, May 2017
19. Since v.5.5.19 a message of type Msg can be sent either as
immutable one:
so_5::send<Msg>(dest, ... /* Msg's constructor args */);
so_5::send_delayed<Msg>(dest, pause, ... /* Msg's constructor args */);
and as mutable one:
so_5::send<so_5::mutable_msg<Msg>>(dest, ... /* Msg's constructor args */);
so_5::send_delayed<so_5::mutable_msg<Msg>>(dest, pause, ... /* Msg's constructor args */);
SObjectizer Team, May 2017
20. To receive and handle a mutable message an event handler
must have on of the following formats:
result_type handler(so_5::mhood_t<so_5::mutable_msg<Msg>>);
result_type handler(so_5::mutable_mhood_t<Msg>);
SObjectizer Team, May 2017
21. Note, that mutable_mhood_t<M> is just a shorthand for
mhood_t<mutable_msg<M>>.
Usage of mutable_mhood_t<M> makes code more compact
and concise. But mhood_t<mutable_msg<M>> can be used
in templates:
template<typename M> // Can be Msg or mutable_msg<Msg>
class demo : public so_5::agent_t {
...
void on_message(mhood_t<M> cmd) {
...
}
};
SObjectizer Team, May 2017
22. With mutable messages the examples above can be
rewritten that way...
SObjectizer Team, May 2017
23. An example with big messages:
struct raw_image_fragment final : public so_5::message_t {
std::array<std::uint8_t, 10*1024*1024> raw_data_;
...
};
class first_modificator final : public so_5::agent_t {
void on_fragment(mutable_mhood_t<raw_image_fragment> cmd) {
cmd->raw_data_[0] = ...; // Now it works.
...
so_5::send(next_stage_, std::move(cmd)); // Send to the next.
}
...
};
class second_modificator final : public so_5::agent_t {
void on_fragment(mutable_mhood_t<raw_image_fragment> cmd) {
cmd->raw_data_[1] = ...; // Now it works.
...
so_5::send(next_stage_, std::move(cmd)); // Send to the next.
}
...
};
SObjectizer Team, May 2017
24. An example with moveable object inside:
struct process_file final : public so_5::message_t { // A message to transfer opened file.
std::ifstream file_;
process_file(std::ifstream file) : file_(std::move(file)) {}
};
class Alice final : public so_5::agent_t {
...
void on_handle_file(mhood_t<start_file_processing> cmd) {
std::ifstream file(cmd->file_name()); // Try to open...
if(file) so_5::send<so_5::mutable_msg<process_file>>(bob_mbox, std::move(file)); // Transfer file.
}
};
class Bob final : public so_5::agent_t {
...
void on_process_file(mutable_mhood_t<process_file> cmd) {
std::ifstream file(std::move(cmd->file_)); // Now it works because cmd->file_ is not const.
... // Some file processing code.
}
};
SObjectizer Team, May 2017
25. But why sending of a mutable message is safer that sending
an immutable message with mutable fields inside?
Are there some guarantees from SObjectizer?
SObjectizer Team, May 2017
27. A mutable message can be sent only to MPSC mbox or
mchain.
It means that there can be at most one receiver of the
message.
An attempt to send mutable message to MPMC mbox will
lead to an exception at run-time.
SObjectizer Team, May 2017
28. A mutable_mhood_t<M> works just like std::unique_ptr:
when you redirect your mutable message to someone
else your mutable_mhood_t becomes nullptr.
It means that you lost your access to mutable message after
redirection:
void on_fragment(mutable_mhood_t<raw_image_fragment> cmd) {
cmd->raw_data_[0] = ...; // Now it works.
...
so_5::send(next_stage_, std::move(cmd)); // cmd is a nullptr now!
cmd->raw_data_[0] = ...; // It will lead to access violation or something similar.
}
SObjectizer Team, May 2017
29. These all mean that only one receiver can have access to
mutable message instance at some time.
This property can't be satisfied for immutable message.
And this makes usage of mutable messages safe.
SObjectizer Team, May 2017
31. Mutable message of type M has different type than
immutable message of type M.
It means that an agent can have different event handlers for
mutable and immutable M...
SObjectizer Team, May 2017
32. An example of handling mutable and immutable message of
the same source type M:
class two_handlers final : public so_5::agent_t {
struct M final {};
public :
two_handlers(context_t ctx) : so_5::agent_t(std::move(ctx)) {
so_subscribe_self()
.event(&two_handlers::on_immutable_M)
.event(&two_handlers::on_mutable_M);
}
virtual void so_evt_start() override {
so_5::send<M>(*this); // Immutable message is sent.
so_5::send<so_5::mutable_msg<M>>(*this); // Mutable message is sent.
}
private :
void on_immutable_M(mhood_t<M>) { std::cout << "on immutable" << std::endl; }
void on_mutable_M(mhood_t<so_5::mutable_msg<M>>) { std::cout << "on mutable" << std::endl; }
};
SObjectizer Team, May 2017
34. A mutable message can be used for service requests (e.g.
for synchronous interactions):
class service_provider final : public so_5::agent_t {
public :
service_provider(context_t ctx) : so_5::agent_t(std::move(ctx)) {
// Service request handler.
so_subscribe_self().event([](mutable_mhood_t<std::string> cmd) {
*cmd = "<" + *cmd + ">"; // Modify incoming message.
return std::move(*cmd); // Return modified value.
});
}
...
};
...
so_5::mbox_t provider_mbox = ...; // Must be MPSC mbox or mchain.
auto r = so_5::request_value<std::string, so_5::mutable_msg<std::string>>( // Initiate request.
provider_mbox, so_5::infinite_wait, "hello");
SObjectizer Team, May 2017
35. But note: mutable service request can be sent only into
MPSC-mbox or mchain.
SObjectizer Team, May 2017
37. When a mutable message is received via mutable_mhood_t
and then redirected via send or request_value/future then
redirected message will also be a mutable message. It
means that redirected message can be sent only to one
subscriber and can be handled only via mutable_mhood_t.
Sometimes it is necessary to remove mutability of a
message and send the message as immutable one. It can
be done via to_immutable helper function...
SObjectizer Team, May 2017
38. Helper function to_immutable converts its argument from
mutable_mhood_t<M> into mhood_t<M> and returns
message hood to immutable message.
This new message hood can be used as parameter for send,
request_value or receive_future. Old mutable message hood
becomes a nullptr and can't be used anymore.
Note: a mutable message can be converted to immutable
message only once. An immutable message can't be
converted into mutable one.
SObjectizer Team, May 2017
39. An example of usage of to_immutable:
void some_agent::on_some_message(mutable_mhood_t<some_message> cmd) {
... // Some actions with the content of cmd.
// Now the mutable message will be resend as immutable one.
so_5::send(another_mbox, so_5::to_immutable(std::move(cmd)));
// NOTE: cmd is a nullptr now. It can't be used anymore.
...
}
SObjectizer Team, May 2017
41. Mutable messages can be sent by send_delayed functions:
// It is a valid call:
so_5::send_delayed<so_5::mutable_msg<some_message>>(
so_environment(), dest_mbox,
std::chrono::milliseconds(200), // Delay before message appearance.
... // some_message's constructor args.
);
SObjectizer Team, May 2017
42. Mutable messages can't be sent as periodic messages. It
means that send_periodic can be used with mutable_msg
only if a period parameter is zero:
// It is a valid call:
auto timer = so_5::send_periodic<so_5::mutable_msg<some_message>>(
so_environment(), dest_mbox,
std::chrono::milliseconds(200), // Delay before message appearance.
std::chrono::milliseconds::zero(), // Period is zero.
...);
// It isn't a valid call. An exception will be thrown at run-time.
auto timer = so_5::send_periodic<so_5::mutable_msg<some_message>>(
so_environment(), dest_mbox,
std::chrono::milliseconds(200), // Delay before message appearance.
std::chrono::milliseconds(150), // Period is not zero.
...);
SObjectizer Team, May 2017
44. Signals do not carry any information inside.
Because of that there is no sense in mutable_msg<S>
where S is a signal type.
Because of that an attempt to use mutable_msg<S> in code
will lead to compile-time error if S is a signal.
SObjectizer Team, May 2017
46. Mutable messages can be used as a safe way of sending
mutable or moveable data in 1:1 interaction.
But 1:1 interaction sometimes can limit level of concurrency
in your application. Because of that it is better to use
mutable messages only if absolutely necessary.
SObjectizer Team, May 2017