Does the ARM processor have invalidate queue? - multithreading

Does the ARM processor have invalidate queue?
I looked up the ARM Architecture Reference Manaul[https://www.scss.tcd.ie/~waldroj/3d1/arm_arm.pdf], but it did NOT mention 'invalidate queue'(it did mention 'write buffer'), so does this mean
that ARM don't have invalidate queue?

Related

How to get memory dump on Azure Functions on Linux plan

On Windows plan there is an option to take a memory dump:
However, this option is missing on Linux plan:
The option which is available for App Services on Linux is not available for Azure Functions on Linux.
Is there a way to get memory dumps for Azure Functions on Linux?
Is there a way to get memory dumps for Azure Functions on Linux?
After researching in my local environment came to a conclusion that we can't take memory dump in Azure Functions with the Linux platform.
And as per the below mentioned answer from Microsoft and many other documents provides only information about memory dump with Windows Platform.
So, I would even suggest you raise a feature request so that it would be helpful for the other members with related issue.

How can I avoid resource leak when using a semaphore?

Linux sem_destroy() documentation says:
An unnamed semaphore should be destroyed with sem_destroy() before the memory in which it is
located is deallocated. Failure to do this can result in resource leaks on some implementations.
But the best I can do is register sem_destroy() to atexit(), which won't be called on aborts or SIGKILL. I have a process responsible for creating and destroying a semaphore on shared memory (a mmaped file), how can I avoid a resource leak on abnormal termination conditions?
On Linux, if the mmaped file is deleted before sem_destroy() is called, is any kind of resource leaked? What resource?
The glibc implementation of sem_destroy does nothing, and this will not change. If you use glibc, you do not have to do anything for freeing up resources. Furthermore, the kernel would free such resources on process termination anyway.
The glibc implementation of semaphores is based on futexes, which is why it does not need any additional resources besides the memory used to store the semaphore.

Wildcards in counter specifiers in Azure Diagnostic

What I am trying to achieve is similar to what you can see in mongo-azure repo, specifically, I want to write Azure Diagnostic Configuration File in such a way so that I can get all the instances of performance counters, for example
\Processor(*)\% Processor Time
and it doesn't seem to be working - no data is visible in the table in my storage account.
Is it achievable at all with configuration, and if so, how?
UPD: We were able to get this working for a simple single VM (so it is possible!), but for some reason it still doesn't work for VMs in VMSS where Service Fabric Cluster is running
UPD #2: We did upgrade to VS 2015 tools 1.5 and now it magically works. I am not really sure if that was the root cause problem or we screwed up anywhere else.
Is it achievable at all with configuration, and if so, how?
Based on the documentation here, it seems it is not possible. From this link:
Performance counters available for Microsoft Azure
Azure provides a subset of the performance counters available for
Windows Server, IIS and the ASP.NET stack. The following table lists
some of the performance counters of particular interest for Azure
applications.
Table that follows below only includes Processor(_Total).
This is possible. We do this in CloudMonix when monitoring VMSS and it is working.
How are you instrumenting Diagnostics and which tables are you looking at?
Specifying \LogicalDisk(*)\Available Megabytes yileds all drives and their free space, for example

Azure changing hardware

I have a product which uses CPU ID, network MAC, and disk volume serial numbers for validation. Basically when my product is first installed these values are recorded and then when the app is loaded up, these current values are compared against the old ones.
Something very mysterious happened recently. Inside of an Azure VM that had not been restarted in weeks, my app failed to load because some of these values were different. Unfortunately the person who caught the error deleted the VM before it was brought to my attention.
My question is, when an Azure VM is running, what hardware resources may change? Is that even possible?
Thanks!
Answering this requires a short rundown of how Azure works.
In each data centres there are thousands of individual machines. Each machine runs a hypervisor which allows a number of operating systems to share the same underlying hardware.
When you start a role, Azure looks for available resources - disk space CPU RAM etc and boots up a copy of the appropriate OS VM in thoe avaliable resources. I understand from your question that this is a VM role - so this VM is the one you uploaded or created.
As long as your VM is running, the underlying virtual resources provided by the hypervisor are not likely to change. (the caveat to this is that windows server 2012's hyper visor can move virtual machines around over the network even while they are running. Whether azure takes advantage of this, I don't know)
Now, Azure keeps charging you for even when your role has stopped because it considers your role "deployed". So in theory, those underlying resources still "belong" to your role.
This is not guaranteed. Azure could decided to boot up your VM on a different set of virtualized hardware for any number of reasons - hardware failure being at the top of the list, with insufficient capacity being second.
It is even possible (tho unlikely) for your resources to be provided by different hardware nodes.
An additional point of consideration is that it is Azure policy that disaster recovery (or other major event) may include transferring your roles to run in a separate data centre entirely.
My point is that the underlying hardware is virtual and treating it otherwise is most unwise. Roles are at the mercy of the Azure Management Routines, and we can't predict in advance what decisions they may make.
So the answer to your question is that ALL of the underlying resources may change. And it is very, very possible.

Resource management by Linux

When a program with some theards, mutexes, shared data, file handles crash because of too much memory allocation, which all resources are freed. How do you recover?
If you mean, how do you go back and free up the resources that were allocated by the now-crashed process, well, you don't have to.
When the process exit(2)'s or dies by a signal all of the OS-allocated resources will be retrieved. This is the kernel's job.
You recover by checking the results of resource acquisition functions and not allowing unchecked errors to occur in the first place.
All resources that belongs to the process are cleaned up.
The only exceptions would be the sysv shared memory/message queues/semaphores - which although might have been created by the process are not owned by it.

Resources