Timers Under Windows 7 Dual Core Processors ?

Aug 27, 2010

After I upgraded from Windows Xp to Windows 7 on any dual core cpu machine my programs that use a simple timer function run incorrectly. The program works with the exact same hardware under Windows Xp and Windows Server 2003. I am using Visual Studio 2005 to write .NET Visual Basic programs that use 2 timers to count down. The first timer, timer1, is set to a value say 150000 ms (150 seconds). The second timer, timer2, is set to 1000ms (1 second). Both timers are enabled one right after the other from a button click event and begin. The timer2 routine running every second updates a label counting down the seconds. When timer1 fires it disables itself and exits. Timer2 also checks to see if timer1 is still running if it is not it will stop. Under Windows Xp and Windows Server 2003 the resulting count in the label is 0 when timer2 detects timer1 has finished. Under Windows 7 when timer1 stops timer2 is not at 0 it is 3 for 150 seconds and gets larger the more timer1 is increased. It appears to me timer2 is not being fired every 1000ms as it was under Windows Xp.

I have included the Visual Basic code below. If you want to test it just run Visual Studio and create a new project. Put the buttons, numericupdown, and labels in your form and past my code into the correct buttons. I have used these type of timer events for years without any problems unit Windows 7. Windows 7 on a single core Pentium 4 with hyperthreading turned on works fine. Windows 7 on a dual core E6500 fails, Windows Server 2003 works.

Public Class Form1

Dim I As Integer

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

[CODE]...

View 2 Replies


ADVERTISEMENT

.net Timer With Windows 7 Dual Processors?

Apr 14, 2010

I have been writing visual basic and vb .net applications for years and have come across this problem with the timer component under Windows 7 32bit on dual core Intel processors. This problem only occurs with Windows 7 running on a dual core processor, single core and under the virtual pc on any processor works.

I have attached a test program to show this problem. The program uses 2 timers to count down to 0. It does not matter what type of timer component I use system.timer.timer or system.windows.forms.timer. I read the system.timer.timer may fix this problem so I changed the program to use it but it did the exact same thing. Left it in anyway.

The program: Timer1 is set to a number of ms for a given amount of time say 150000 for 150 seconds and started. The timer will expire correctly. At the same time a second timer Timer2 is set to 1000 ms for a count down display to 0. Timer2 fires and the count is updated. This happens and everything looks fine. When Timer1 fires I disable timer2 so it will stop counting down. Timer2's countdown is at 2 instead of 0. It is firing slow. If I increase the value of timer1 to say 500 seconds timer2 is behind by 6 seconds. These amounts are the same for the 2 very different computers I ran this on but both are dual processor systems running Windows 7. The exact code works correctly on Windows Xp on the same processors and works under Windows 7 on a Pentium 4 system.

[Code]...

View 16 Replies

Dual Screen Video Player With Windows 7 Thumbnail Preview?

Aug 25, 2010

I try to create a dual video player with VB 2010.

With that I have 2 forms, 1 main form (with all the controls and it should contain a preview screen of what is being displayed on the second form.

And a second form (with a windows media player component).

Now the main form should have (as told) a preview screen of what is shown on the second screen, I want to know if it is possible to have is as the windows 7 taskbar thumbnail (when preview the mediaplayer).

View 2 Replies

Way To Distinguish Hyperthreaded Processors From Non-hyperthreaded Processors?

Aug 18, 2011

Is there code or a way to distinguish Hyperthreaded processors from non-hyperthreaded processors? I know how to detect hyperthreading in general But this is whether or not a logical processor has it but not specific processors.

View 1 Replies

Make A Code That Sends One Application Or Program In 1 Core And Other Application In Other Core?

Jan 29, 2010

I'm using VB 2008, and I have a dual core computer.Is it possible to make a code that sends one application or program in 1 core, and other application in the other core?

View 1 Replies

VS 2008 Do Timers Work In Windows Services

Oct 28, 2010

Do Timers work in Windows Services?

View 13 Replies

Coding For Multicore Processors?

May 27, 2010

What i have heard is, that a program dont get much faster on a dual core (or quad core) than on a single core processor, because windows assigns the program to just one core. (but still a little faster because other programs run on the other cores instead or something like that).And if you want to exploit the power of multicores, you have to code in a way so that different calculations get sent to different cores simultanuasly and then gather the result afterward.First of, is this correct? And if so (or if not so) is it possible to program in vb to exploit multicores. I mean can you create 4 threads and assign them to each core, or does this require some heavy C++ coding?The reason im asking is because and application i have created uses biometric identification (fingerprints) and this requires somcalculations, the more fingerprints that gets stored. Then if i somehow could make it use more codes, maybe this will be a little faster?Is this possible in vb, or would i get way in over my head for trying to work with th

View 1 Replies

VS 2005 Controlling System Processors?

Jul 29, 2009

I want to control all the processes of my system. for instance, whenever i start a new process, my application has to ask me whether to allow it or not. I should have control to either pause, resume or terminate the process. for eg,if i start IE, my application should ask whether to allow the process or terminate it. if i provide "allow", the process should run, either it should terminate. Can i use "process" control to do these stuffs? Or do i need any API?

View 1 Replies

.net - Accurate Windows Timer - System.Timers.Timer() Is Limited To 15 Msec

Jan 15, 2009

I need an accurate timer to interface a Windows application to a piece of lab equipment.I used System.Timers.Timer() to create a timer that ticks every 10 msec, but this clock runs slow. For example 1000 ticks with an interval of 10 msec should take 10 wall-clock seconds, but it actually takes more like 20 wall-clock sec (on my PC). I am guessing this is because System.Timers.Timer() is an interval timer that is reset every time it elapses. Since it will always take some time between when the timer elapses and when it is reset (to another 10msec) the clock will run slow. This probably fine if the interval is large (seconds or minutes) but unacceptable for very short intervals.Is there a function on Windows that will trigger a procedure every time the system clock crosses a 10 msec (or whatever) boundary?

UPDATE: System.Timers.Timer() is extremely inaccurate for small intervals.I wrote a simple program that counted 10 seconds several ways:

Interval=1, Count=10000, Run time = 160 sec, msec per interval=16
Interval=10, Count=1000, Run time = 16 sec, msec per interval=15
Interval=100, Count=100, Run time = 11 sec, msec per interval=110
Interval=1000, Count=10, Run time = 10 sec, msec per interval=1000

It seems like System.Timers.Timer() cannot tick faster that about 15 msec, regardless of the interval setting.Note that none of these tests seemed to use any measurable CPU time, so the limit is not the CPU, just a .net limitation (bug?)For now I think I can live with an inaccurate timer that triggers a routine every 15 msec or so and the routine gets an accurate system time. Kinda strange, but...I also found a shareware product ZylTimer.NET that claims to be a much more accurate .net timer (resolution of 1-2 msec). This may be what I need. If there is one product there are likely others.

View 5 Replies

VS 2008 Difference Between System.Timers.Timer And System.Windows.Forms.Timer?

Jun 15, 2009

I'm wondering what exactly is the difference System.Timers.Timer and System.Windows.Forms.Timer???

View 4 Replies

MessageBox And Dual Monitors?

Aug 10, 2010

If a form is being displayed on the secondary monitor, is there a way to make sure that a MessageBox generated by that form will display back on the primary monitor? The form is being displayed over a projection system and some messages do not need to be seen by the audience, just the computer operator.

View 1 Replies

Controling Which Monitor When Dual Monitors

Oct 27, 2011

I just got this really cool 9" monitor (USB attached) which I will be using for dialogs in my vb application. Can someone tell me why this code displays on both machines? if I change screen=AllScreens(1) to (2) the form is only shown on the primary but I want to show it on the very cool USB screen.

[Code]....

View 3 Replies

Dual-purpose Cut/Copy/Paste ?

Jul 19, 2010

My app displays a list of records in a DataGridView on the main form. I've developed code for cut/copy/paste for the selected records and have put the code behind Cut/Copy/Paste menu items under a classic 'Edit' menu design, with the standard shortcut keys(Ctrl + X, Ctrl + C, Ctrl + V).

The trouble is, I also want the shortcut keys to work on selected text when I'm editing inside text fields on a record in the DataGridView. So I need the shortcut behaviour to change depending on whether I'm editing a record or selecting record(s).

View 5 Replies

Make Dual Monitor Intergration

Feb 8, 2012

I have a form1 and many other sub forms in my software.I want all those forms to work on a 2nd monitor (if the user does have a 2nd monitor)while working on my 1st monitor as well.But i don't have 2 monitors in my system hence i cant test this feature out.But dual monitor integration is a very important part of my software.

View 1 Replies

SELECT CURDATE() FROM Dual [Error]

Sep 15, 2009

The command works but im getting an incorect time It returns 15/9/2009 12:00:00 the date is fine (was ok when this thread was written)but the time is always the same 12:00:00 Is something wrong with the server or am i entering not the right command?

View 1 Replies

Single Display Vs. Dual Clone

Nov 11, 2010

Is there a simple way to differentiate single display vs. dual display clone? I am asking about dual clone, not extended desktop. .Net Screen class treats dual clone as single display. I could not find useful WMI method also.

View 6 Replies

VS 2005 Dual Display Support?

Jun 16, 2009

Is this possible in VB 2005? Mirroring or extending over a second display?

View 2 Replies

Using More Than One Of Cpu Core?

Feb 9, 2011

i have intel core quad cpu but my program cant use more than one of cores(it use 25% of cpu power but i want use 50% and more).

affinity is "<All Processors>" and all of cores are selected.

is there any way can use more than 50% of cpu power.

View 6 Replies

Addressing Individual Monitors In Dual Screen?

Jul 8, 2009

I am working on a custom bulletin board system for my company. The idea is to have a program running that displays a full screen bulletin board on many monitors around our facility. I wrote a VB client that pulls from a server and displays a single board perfectly - I am wondering how to expand this.

View 10 Replies

Dual Listbox Mover Type Control?

Oct 30, 2009

I need a 2-listbox mover/selection type control such as the example here: [URL] For over a week now I've searched countless forums and done myriads of googles. All I've been able to find is C++ or ASP based stuff. I really would like this to be VB.net, but at this point, I'd even settle for C#.

I've taken a shot at developing it myself, but am too new to the .Net world to really get anywhere with it other than being completely overwhelmed and frustrated. I've even looked at some 3rd party custom control webistes, and am even willing to spend a few bucks for this thing, if I could find one that suits my needs.

[Code]...

View 6 Replies

Dual Monitor Support After Gfx Driver Update

Sep 28, 2009

I've got a dual monitor setup, my main monitor is a Dell 20" 1680x1050 res, secondary is a Dell 17" 1280x1024.I've just updated my gfx driver (nvidia driver version 190.62).I'm using code like that shown below to get the screens and I always assumed that AllScreens(0) would be the primary screen and AllScreens(1) would be the secondary but this appears to be reversed since I updated my driver.

[code]...

Is my coding in error or is Windows reporting the screen information wrongly ? How can I be sure to set AllScreen(0) as the users primary screen and AllScreens(1) as their secondary ?

View 1 Replies

Dual Monitor With Touchscreen Browser Control?

Jan 21, 2012

i am looking for a way to make a clone of 2 webbrowsers when i make a click in the first webbrowser it shows the same in the second webbrowser

detailed:i am making a program with a touchscreen and a hdtelevision setup as extended monitor at the touchscreen you can control what is happening on the tv now i want to control a webbrowser but the problem is i want a internetbrowser on the touchscreen where i can make changes and clicks on the websites
and then i want also to view the internetbrowser on the tv to see the website this is meaning i want a clone from the internetwebbrowser from the one on the touchscreen to a clone on the hdtelevision some sort of linked copy/clone of the webbrowsers

View 6 Replies

How Can It Full-screen If The Computer Has Dual Monitors

Nov 5, 2009

i've managed to have the form in fullscreen.. How can it fullscreen if the computer has dual monitors?

.MaximizeBox = False
.MinimizeBox = False
.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None
.WindowState = System.Windows.Forms.FormWindowState.Maximized

View 2 Replies

Prevent Dual Login Of Users In Web Application?

Feb 7, 2010

how do I prevent my users for more than one simultaneous login per account. I am using Vb.Net SQL.

View 2 Replies

Set A Certain Thread To Run On The 2nd Core?

Dec 21, 2009

how i can set a certain thread to run on the 2nd core for eg...

View 8 Replies

For Loop CPU 25% Single Core

Oct 15, 2010

For loop CPU 25% single core

View 6 Replies

Possible To Split Up Threads (currently 6) So That 3 Run On Each Core?

Oct 18, 2011

I have a VB.NET app that spawns several threads for performing XML parsing/database interaction. Only one of my cores (only have 2 currently) is being used right now.I've looked at Task Parallelism in .NET 4 but I need to be able to start a task at different times (not all at once).Is it possible to split up the threads (currently 6) so that 3 run on each core? Also, if I don't want to limit my threads to 6, how can I check CPU/memory programmatically to find out if I can start another thread.

View 2 Replies

Use The Core Audio API In VB 2010?

May 20, 2012

I've been trying, without any luck whatsoever, to figure out how to use the Core Audio API in VB 2010. I started by downloading a wrapper dll located here: [URL]

[Code]...

View 2 Replies

.net - Null Reference Exception DNN Core 5.6.3

Jul 26, 2011

My site has been running fine for sometime now until recently I see in the event viewer a null reference exception in the DNN core:

DotNetNuke.Common.Globals.GetStatus() in

F:BuildsMaintenanceWorkingDirectoryLibraryCommonGlobals.vb:line
1125 at DotNetNuke.Common.Initialize.InitializeApp(HttpApplication
app) in

[code]....

the line 1125 is:

_Status = UpgradeStatus.None

Which is a property of the Globals class and an Enum Also when this happens it doesnt just do it once then sort its self it does it roughly every minute for an hour or so.I made sure all dataprovider.instances are either in a using or a try catch finally or self closing(if the reader is not used)?

View 2 Replies

Calcualte CPU Usage For An X-Core Machine?

Aug 2, 2010

Trying to make a badly archictected system work. In doing so we have ourselves in a postion of shelling mulitple instances of a program and managing the running processes. On startup the shelled program is CPU intensive and we need to limit the rate that we initiate the instances based on the CPU load. How do you calculate the CPU load of a multicore system?

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved