I have a system that has five programs that all communicate with each other
via Message Queues. Works well. One program is a watchdog that will make
sure the others are up and going. Currently I have it store info it gets
from when the programs check in into a DataSet (XML file). Problem is, that
file now has to be used by other programs to find out version information
(the file is ALWAYS less that 1K.) The record itself is only five fields and
there are five records usually in the dataset.
I'm running into problems with file contention and I was thinking instead of
writing to a file how about if I use the registry? I've tried using Mutexs
and having problems with it. SQL/Database is not an option.
So I wanted to know, is reading/writing to the registry frequently (each
program would write to it every minute, one of the programs would read it
every minute.) problematic?
If I'm doing lots of reading/writing will it do anything to the machine;
i.e. - slow it down, cause problems with the registry, cause problems in
Windows ?
Is the size of the registry an issue ?
TIA - Jeff. 5 5063
Hi,
As far as I know, reading and writing operations against the Windows
Registry are pretty fast!
I would not worry too much about the "Registry size". Especially
because you say that there are only 5 records (each holding 5 fields)
in the dataset. This would boil down to 5 Registry keys with 5 subkey's
each. That should not be a problem!
However, you will be abusing the registry. The registry isn't exactly
designed for holding "process state info" (although it can be used that
way). I do not really understand what you're needing the "file" (or the
registry) for. Why don't you just keep the data you need in memory? You
could use message queues to query for the data, instead of using a file
for this.
Good luck,
Alke Wiebenga
UJ schreef:
I have a system that has five programs that all communicate with each other
via Message Queues. Works well. One program is a watchdog that will make
sure the others are up and going. Currently I have it store info it gets
from when the programs check in into a DataSet (XML file). Problem is, that
file now has to be used by other programs to find out version information
(the file is ALWAYS less that 1K.) The record itself is only five fields and
there are five records usually in the dataset.
I'm running into problems with file contention and I was thinking instead of
writing to a file how about if I use the registry? I've tried using Mutexs
and having problems with it. SQL/Database is not an option.
So I wanted to know, is reading/writing to the registry frequently (each
program would write to it every minute, one of the programs would read it
every minute.) problematic?
If I'm doing lots of reading/writing will it do anything to the machine;
i.e. - slow it down, cause problems with the registry, cause problems in
Windows ?
Is the size of the registry an issue ?
TIA - Jeff.
While I am not so sure that using the Registry as a sort of temporary Data
Store is the best way to solve your issue, no, Registry access is very fast.
In fact, if you download yourself a copy of RegMon and have it running you'll
see all kinds of registry traffic going on in your pc even if you arent'
actually doing anything.
HTH,
Peter
--
Co-founder, Eggheadcafe.com developer portal: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
"UJ" wrote:
I have a system that has five programs that all communicate with each other
via Message Queues. Works well. One program is a watchdog that will make
sure the others are up and going. Currently I have it store info it gets
from when the programs check in into a DataSet (XML file). Problem is, that
file now has to be used by other programs to find out version information
(the file is ALWAYS less that 1K.) The record itself is only five fields and
there are five records usually in the dataset.
I'm running into problems with file contention and I was thinking instead of
writing to a file how about if I use the registry? I've tried using Mutexs
and having problems with it. SQL/Database is not an option.
So I wanted to know, is reading/writing to the registry frequently (each
program would write to it every minute, one of the programs would read it
every minute.) problematic?
If I'm doing lots of reading/writing will it do anything to the machine;
i.e. - slow it down, cause problems with the registry, cause problems in
Windows ?
Is the size of the registry an issue ?
TIA - Jeff.
Personally I'd advise you to stick with files and mutexes - it is a very
simple solutions, and should be very portable between environments (if that
ever becomes an issue), plus it avoids all sorts of registry access
permissions / identity issues. You didn't respond to yesterday's question to
explain what these contention issues /were/ (the real symptoms) - care to
elaborate?
Marc
I've got a file that is created by a program. Other programs that are
running need to access that file. (This file contains things like what
programs are running, when was the last time we heard from the program, what
version the program is, ....) I tried first doing a mutex but somewhere
along the way something would happen where the mutex wouldn't get released
right. So the other programs couldn't get at the file. Or if they did, they
had to wait for a period of time before they gave up on the mutex and read
the file anyway.
So I took out the mutex and had the originator create the files multiple
times in different directories for the different programs. (It should be
noted that the file is created minute and the programs poll the file every
once in a while.) This seemed to work OK but seems real cumbersome.
I suppose another way to do it would be to use a Message Queue to request
the dataset from the program that is creating it and send it out to
everybody. Everybody else could keep the thing in memory and not even bother
writing it out.
TIA - Jeff.
"Marc Gravell" <ma**********@g mail.comwrote in message
news:u0******** *****@TK2MSFTNG P02.phx.gbl...
Personally I'd advise you to stick with files and mutexes - it is a very
simple solutions, and should be very portable between environments (if
that ever becomes an issue), plus it avoids all sorts of registry access
permissions / identity issues. You didn't respond to yesterday's question
to explain what these contention issues /were/ (the real symptoms) - care
to elaborate?
Marc
Such process 'management' tasks are best implemented using System.Manageme nt
namespace classes (WMI).
Let the producer (the watchdog) fire an event type
(Instrumentatio nType.Event) into the WMI subsystem whenever something
changes that is of interest to the consumer(s), let the consumers (the
programs) register an event watcher, no files needed no polling, instant
eventing.
Willy.
"UJ" <fr**@nowhere.c omwrote in message
news:Ox******** ******@TK2MSFTN GP05.phx.gbl...
| I've got a file that is created by a program. Other programs that are
| running need to access that file. (This file contains things like what
| programs are running, when was the last time we heard from the program,
what
| version the program is, ....) I tried first doing a mutex but somewhere
| along the way something would happen where the mutex wouldn't get released
| right. So the other programs couldn't get at the file. Or if they did,
they
| had to wait for a period of time before they gave up on the mutex and read
| the file anyway.
|
| So I took out the mutex and had the originator create the files multiple
| times in different directories for the different programs. (It should be
| noted that the file is created minute and the programs poll the file every
| once in a while.) This seemed to work OK but seems real cumbersome.
|
| I suppose another way to do it would be to use a Message Queue to request
| the dataset from the program that is creating it and send it out to
| everybody. Everybody else could keep the thing in memory and not even
bother
| writing it out.
|
| TIA - Jeff.
|
| "Marc Gravell" <ma**********@g mail.comwrote in message
| news:u0******** *****@TK2MSFTNG P02.phx.gbl...
| Personally I'd advise you to stick with files and mutexes - it is a very
| simple solutions, and should be very portable between environments (if
| that ever becomes an issue), plus it avoids all sorts of registry access
| permissions / identity issues. You didn't respond to yesterday's
question
| to explain what these contention issues /were/ (the real symptoms) -
care
| to elaborate?
| >
| Marc
| >
|
| This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Lee |
last post by:
I have created a custom log for my apps to write to. Writing to the log seems
to be no problem, it's when I go to read it I get unexpected results. I have
an application that reads the log and displays it's contents in a grid, and
it also receives event notification from the log when it's updated. When the
event fires I get exactly the text that was logged in exactly the way I
logged, but when I read the entries from the log, or view them...
|
by: Dhilip Kumar |
last post by:
Hi All,
I'm writing a Windows Service app using C#. I need to read some
configuration settings before the service starts up. These settings will be
used by the service in its operation. Question is, which is the best way to
store & retrieve the settings? I'm thinking of storing it in the registry
in HKLM\Software\ServiceName and access it using the Registry class in the
"public ServiceName()" method. I'm instructing the service...
|
by: Bry |
last post by:
I'm having problems writing (and reading) boolean data to the registry.
// Write a boolean value to the registry
// I've not included the obvious bits of code in these samples
bool myBool = true;
myRegistryKey.SetValue("SomeValue", myBool);
This gives me a registry value with string data containing "True"
// Read my boolean data back from the registry
|
by: Peter John |
last post by:
I am using the following code to read from and write to the registry.
The writing works fine but reading always fails. Can anyone suggest
what is going wrong?
Imports Microsoft.Win32
Public Class clsRegistry
Private Const conRegKey As String =
"Software\MyCompany\MyApplication"
|
by: RhavoX |
last post by:
Hi. This may be a very stupid question but I'll leave you to judge
it ;) I know there were lots of questions about this but none of the
answers suits me.
I'm wondering how to get the BINARY type data from the registry and
how to display it as hex in a way I'm showing below.
Let's say I use this key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion
\Prefetcher
The value of LastDiskLayoutTime is: 6A C7 49 ED 50 5F C7 01
| |
by: projectVBA |
last post by:
Hi ,
I wrote some add in for PowerPoint and i'm trying to find an automatic way to load it every time PowerPoint starts.
I found Microsoft Code example (see below ) BUT the problem is :
I can't find all appear function declaration and VBA also errors regarding all the default variable values give in the code like ERROR_SUCCESS etc.
May be you can help me to make this code run??
Function RegisterAddin( _
strBranch As String, _...
|
by: terryastone |
last post by:
I have an application that reads some registry values stored in the
Local Machine\Software\... key.
In XP, I can see these values using RegEdit. In my application I can
read the values at startup, and change the values during the
application.
In Vista, I CANNOT see the values using RegEdit but I can read the
values using the application. I created some values using RegEdit in
the place where my values would be. Now I can see them...
|
by: Andrus |
last post by:
For file based export-import with existing programs I need to implement dbf
format file read/write from my .NET 2 winforms application.
It is not possible to force users to install something so this must be
included with my application.
Where to find C# source code which read/writes dbf files ?
Andrus.
|
by: Guillaume Dargaud |
last post by:
Hello all,
anybody knows if there's some ANSI-C conformant code around that can read
Windows-style .ini files ? I don't care about writing to it but I need to be
able to read it from various OSs, so there shouldn't be any Windows
includes.
It doesn't look like it's too hard to do, but there are a few tricks (like
multiple line strings), so I'd love to save some time (who doesn't).
--
Guillaume Dargaud
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |