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


ADVERTISEMENT

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

Event Consumption For Concurrency In A Multicore Application?

Jan 18, 2010

Target machine 4 core AMD I have an event that is raised my the main thread of the application. The event is consumed by several different classes in the application. I want them all to run concurrently up to the max cores available and then que the rest in order.The work routine in each class is relatively small but concurrency is the goal.Considering this.

A. Create a background worker on each classes initialization and have the event handler start the worker.

B. Create a delegate to the do-work sub that is called by the event handler

A- Pros - worker is only created once and reusable so only pay creation cost once.

A-Cons could create a ton of workers that consume resources eventually.

B- Pros Smaller thread pool

B- Cons Lot of overhead

View 2 Replies

Parallel Extensions Automatically Handle Single And Multicore Environments?

Apr 8, 2009

Will LINQ's parallel extensions automatically detect the number of cores and utilize them all? Conversely, if the code is run on a single core machine, will it still work or do I have to detect the number of cores and tell PLINQ how many to run across? I don't have access to any single core machines to test my code on so I can't even test this for myself and I haven't been able to find any useful info elsewhere...

Also, while it might at first seem obvious when to use parallelism, are there any rules of thumb regarding where it should and as importantly should not be used? I don't necessarily program in a specific environment. I tend to divide my time somewhat equally (depending on project) between web, client/server apps, windows apps, windows service and console utilities depending on the task at hand.

View 2 Replies

.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

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

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

Hard Coding Vs Soft Coding

May 7, 2009

Say we have a DataGridView on the main form. I can chose to establish its properties by code or by selecting them in the Properties panel. Is there a difference between these two techniques, a loading time penalty in any of the cases especially?

View 5 Replies

Using All Cores Of Multi-cores Processors In VB 2010?

Mar 6, 2012

If i want my program to exploit all cores of a processor do i need to add extra code? If yes do you know a link to a tutorial that explain how to do it in VB 2010?

View 10 Replies

Add A Textbox With Coding?

Mar 28, 2009

Ok, I don't even know if the is possible, but what I want to do is have a button that when pressed will add a new text box below each other each time it is pressed. So meaning, ther4e is text in one text box, then a button is pressed, a new textbox will appear below it and you can add text to that, and so on.

View 1 Replies

Add Button With Coding?

May 15, 2010

I was wondering if you can programme in a code to add buttons to a page, without physically putting them in.Ive got a customisable set of options, currently in a txt file 1 item per line maybe thinking of putting into a listbox, if a user adds an item i need it to add a button with that text on.

say i had a drink list, with my first 3 items of beer, cocktail, food, and theres a button prest for each one and i decided to sell wine, shandy, rout beer and so an so on, or how ever many items there are, could be 50 items or 100 items don't really fancy?

View 12 Replies

C# - Coding Standards For .NET?

Oct 25, 2010

Possible Duplicate: C# Coding standard / Best practices

What VB.NET or C# coding standards are you using for your .NET applications?I was looking at hungarian notation and I don't think it is a good idea for a .NET application.

View 7 Replies

Coding For Sql Update

Aug 21, 2011

I have a probelm to my quotation..

View 22 Replies

Coding With A New Object?

Jan 5, 2009

I'm creating a game similar to the tradtional space invaders in VB '08. My problem is twofold. One, when I dim a new picture box (picPrimaryLaser) it won't move. Two, I can't do anything while it's moving. The screen just turns white and flashy around that area.Here's the code.

Public Class frmMainInvasion
Dim activationCheck As Boolean = False
Private Sub frmMainInvasion_FormClosing(ByVal sender As Object, ByVal e As

[code].....

View 3 Replies

Database Coding In VB?

May 3, 2010

Could someone be able to advise what does the following code do i.e what does this mean in English:

ATableAdapter.Fill(Me.HotelBookingDataSet.FreeRoom, roomDateTimePicker.Value.Date.AddHours(timeNumericUpDown.Value))

View 3 Replies

Email By Coding On .NET?

Apr 28, 2009

<Visual Studio 2005. VB.NET.> Does anyone has a sample code to send an e-mail like below?

Namespace My
Partial Friend Class MyApplication
Private Sub MyApplication_NetworkAvailabilityChanged(ByVal sender As Object, ByVal e As Microsoft.VisualBasic.Devices.NetworkAvailableEventArgs) Handles Me.NetworkAvailabilityChanged
MsgBox("Network Connection has been changed", MsgBoxStyle.Information, "Network Connectivity")
"Send an error email to admin"

[Code]...

View 4 Replies

Get Rid Of Html Coding?

Nov 26, 2009

I'm currently extracting strings from the page source of a certain website. I'm using the start string and the length to get the string I want. However, the problem is that it contains some html codes such as href, a, li etc. Is there a way in which I can copy the text only and not the code?

View 22 Replies

How To Improve My Coding

May 28, 2011

Whenever i work on form, so i use this code

CODE:

Now i have 2 things to ask?

1) is this right way which i use?

2) I use the same on every form regardless on number of forms? is it fine to use it on every form?

View 3 Replies

Keep Dataset Changes While Coding?

Apr 19, 2009

I have a dataset which i'm sure that i am able to change the data held wihin it. But the datachanges don't stick when i stop running the prog and restart.

View 6 Replies

Reboot PC From Coding

May 10, 2012

how to reboot the PC from coding with VB.Net framework 2.0 or above.i also like to set timer for rebooting process.does VB.net framework support for above process? do i need to add library or DLL file

View 4 Replies

Validation On My Coding

Jun 15, 2012

I have a newbie question hopefully the more experienced vb heads will be able to help me with, I have a command button which works like the following [code] I was thinking would it be possible to only run 'Code 4 if the messagebox.show has not appeared for Code 1, Code 2 and Code3?

View 1 Replies

VB Coding In Excel?

Jun 21, 2011

I think I have a simple program to create, but I just cannot find the syntax to complete it.Effectively, what I'm trying to do is search down a column where there are cells with numbers and cells that are blank. I want to search down the column and find where there are two or more cells that that have numbers, one after another. I want to add a row beneith the last number and then add up the total of that batch of numbers in that column were searching down. I know that I'll be using a loop to step down each cell in the column to check on the contents of the cell. Also I want the loop to go from the top of the colum to the last record since the list length will frequently change.

View 5 Replies

VS 2008 Tic Tac Toe Coding?

Apr 22, 2009

I Have a project to do for the class and i start to do it but i am not able to do the last part which is ( if there is no win, it should say drew) i do not know how.lp me on that and if you can give me easier way ti am using visual basic 2008 express.here is the codeode

Public Class Form1
Dim player As Integer
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles

[code]...

View 2 Replies

What Is The Regex Coding

Jun 17, 2009

i am not sure how to use those as a regex coding so basically i need help with translating the following shown below into regex coding: -(e.g. car as regex = new regex(" ") )

1. Car Licence Number (e.g.1ASD324)

2. Date(e.g. dd/mm/yy)

View 2 Replies

(VB9) Coding Size Of Boxes?

Dec 7, 2010

I'm trying to set the size of a box without setting it in the properties dialogue box. My reason for doing so: I have text boxes stacked on top of each other. I need to alter properties of them after I place them and don't want to scroll through the list of objects (there are a lot) in order to find that specific item. Instead, I want to place them at different places in the form and then tell them where to be located, and what size they should be UPON FORM LOAD. I can't seem to locate the proper syntax in the book I am using, but from logic I have reached the following beginning of the line of code:

Me.txtVidPro.Size = 561, 130
Me.txtVidPro.Location = 63, 258

the only part I'm getting an error on is the x and y coordinates. please help me by pointing me in the right direction.

View 3 Replies

.NET Project Coding Documentation?

May 25, 2010

I want to know the professional way to comments VB.net project coding. In future, it may help to other people, whom may update my project.

View 4 Replies

An Unexpexted Error During Coding?

Mar 15, 2011

I'm working with Visual Studio 2008 and SQL Server Compact.My database program was working great and I have been able to get a lot of stuff done. Just a moment ago I created a simple command in my VB code and decided to check if it works.No mapping exists from DbType AnsiString to a known SqlDbType.The error occurred in the DataSet.Deisgner.vbThe part of code it focused on was:

<Global.System.Diagnostics.DebuggerNonUserCodeAttribute()> _
Protected ReadOnly Property CommandCollection() As Global.System.Data.SqlServerCe.SqlCeCommand()

[code]....

View 16 Replies

BGW With Similar Coding But Different Approach?

May 18, 2012

I've two BGW with similar coding but different approach, My second BGW shows me "NOT RESPONDING" whenever i try move/click/focus to form while the BGW is running.

VB
RichTextBox2.AppendText("Some Text")
process2.ReportProgress(inc)
My.Computer.Network.DownloadFile(andpic, "pics/" & spliti(0) & nnum & ".png")
My.Computer.Network.UploadFile("pics/" & spliti(0) & nnum & ".png", "ftp://ftp.mywebsite.com/domains/mywebsite/public_html/Pics/" & spliti(0) & nnum & ".png", "users", "password")
WebBrowser1.Navigate("Mywebsite")

I've taken out number of things that i think is causing this error Are they the cause of "NOT RESPONDING" ?

View 4 Replies

Chage C# To Program Coding?

Dec 9, 2009

How to change this coding to vb.net coding? [code]...

View 2 Replies

Coding - Backgroundworker Repeats Itself ?

Jul 12, 2011

I'm down to the final coding on one of my projects, when i notice that the backgroundworker behaved strange. For each time i run the backgroundworker, it repeated it self one more time, and the new time, it repeated one more time.

So, if i run the worker a third time, it would repeat it self 3 times.

First run: Runs one time
Second run: runs twice
Third run: run 3 times
And so on.

So, i'll post all the code from that form.

Here goes.

CODE:

View 2 Replies







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