C# - Setting The Cores To Use In Parallelism?

Jun 2, 2010

I have a feeling the answer to this is no, but using .Net 4.0's Parallelism, can you set the amount of cores on which to run i.e. if your running a Quad Core, can you set your Application to only use 2 of them?

View 1 Replies


ADVERTISEMENT

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

Set CPU Affinity For 4 Cores Machine?

Nov 5, 2009

In my application I has a feature to set CPU application affinity for the application. I have a combo box with the following items:

Item 0: "ALL" -> It's point that if select the application will use all available CPUs
Item 1: "1" -> For set application to use first core
Item 2: "2" -> For set application to use second core
...
Item N....

Where N is the total numbers of CPUs/cores available in the system.

Now when the user click in one of this I execute this

Private Sub comboCPUAffinity_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles comboCPUAffinity.SelectedIndexChanged
Dim num As Integer = comboCPUAffinity.Items.Count - 1

[Code]....

This works well in my vista 2-cpu machine, and also in 1 core machines. The problem is that I have release the application and has a user who has a 64bits vista 4 cores machine, and when execute the above code the application causes a buffer overflow. This is maybe because I have something bad in the code which can not test because I have not the machine to test.

View 6 Replies

VS 2010 Set Program's Affinity To Be Able To Run On All Cores?

Jun 22, 2012

How do I set my program's affinity to be able to run on all cores?

Yes, I know the default is all cores, but I want to know how to set it in code.

Currently, I use:

Process.GetCurrentProcess.ProcessorAffinity = CType(Environment.ProcessorCount + 1, IntPtr)

View 2 Replies

Asp.net - Was Visual Studio 2008, 2010 Or 2012 (v11) Written To Use Multi Cores

Nov 28, 2009

Basically i want to know if the visual studio IDE and/or compiler in 2010 and 2012 was written to make use of a multi core environment (i understand we can target multi core environments in all versions using parallelism, but that is not my question).I am trying to decide on if i should get a higher clock dual core or a lower clock quad core, as i want to try and figure out which processor will give me the absolute best possible experience with Visual Studio 2010 or 2012 (v11) (ide and background compiler).

If they are running the most important section (background compiler and other ide tasks) in one core, then the core will get cut off quicker if running a quad core, especially if background compiler is the heaviest task, i would imagine this would be difficult to separate in more than one process, so even if it uses multi cores you might still be better off with going for a higher clock CPU if the majority of the processing is still bound to occur in one core (i.e. the most significant part of the VS environment).

View 6 Replies

Setting Short Function By Setting Poker Game Points?

Aug 23, 2010

I need help and wondering if you can help me to get my first project...it's a hobby and wondering if you can get me code for this so i can see how it does it* Evaluate( ) Prints the evaluation of the hand to the evaluation Label.

o If IsFlush( ), prints "flush; "
o calls SetPipArray( )
o Uses a For Loop to go through pipArray. For each element, uses a Select Case statement to

[code]....

View 9 Replies

Setting Variables To Store User Setting For Applications

Feb 13, 2012

In our projects we use setting variables to store user setting for the applications. Moreover, with every latest version of the applications, we upgrade these variables to retain user settings.Normally, this works fine, but recently one of my end user reported an error i.e.Configuration System failed to initialize". The error is related to user.config file. Therefore we requested the user to send us his file.After received the folder, we noticed that it contains 3 files (3begfjb.newcfg,3begfjb.tmp and user. config). 3begfjb.tmp is an empty file, while 3begfjb.newcfg and user.config are identical files. We tried to open these files but the data in user.config isn't proper xml rather its unreadable formatted file.Do any you guys had experienced this sort of issue or any ideas how and what may have created these files and corrupted user.config file.

View 3 Replies

.net - Setting Objects To Nothing?

Feb 24, 2009

If you have a sqlClient.sqlconnection object, in the cleanup code (finally block etc) do you dispose of the object or do you set it to nothing, or both?

I've always just called the dispose, and allowed the garbage collector to do its thing...

View 8 Replies

App Are Not Save Setting

May 4, 2010

My.Setting is working ! But when I add form to project then my app are not save Setting ! Now , how can fix it !

View 2 Replies

EventHandler Setting Value Of -1?

Jul 1, 2009

Me.SetProgressBars()
AddHandler zip.SaveProgress, New EventHandler(Of SaveProgressEventArgs)(AddressOf Me.zip_SaveProgress)
zip.Save(target)

Took some snippets from a MSDN page and molded it into my project ... problem is on every run its setting a value of -1 to something and i cant for the life of me figure out what to!

Private Sub zip_SaveProgress(ByVal sender As Object, ByVal e As SaveProgressEventArgs)
Select Case e.EventType
Case ZipProgressEventType.Saving_AfterWriteEntry

[code].....

View 2 Replies

How To Setting The SQL Server

Dec 8, 2011

how to setting the SQL Server

View 6 Replies

Loop Through All My.setting?

Dec 7, 2009

I kinda found a way to get the name.. but not the value.. anyone have some sample code to just run thought the settings and spit out the name and value ?

View 3 Replies

Setting A BIT In A BYTE

Feb 1, 2010

I think the way to do this in VBnet involves binary math? -- no "easy" way I don't think (like picbasic mybyte.0 = 1 mybyte.1 = 0 etc).I know you can read a bit by using convert.toint32 (2^0) (2^1) etc. and comparing to an integer value but my head is going in circles on how to set (write) a bit value. I need bytes because I intend on writing to the serial port.If bit0 is 1 then mybyte bit 0 = 1.

View 33 Replies

Setting Focus On A Tab In .net?

Jul 12, 2011

I have a tab in a windows form called Wafer Map that has three sub-tabs. The First sub-tab is the called Map and has a Load and Skip button. I am trying to set the focus on the Wafer sub-tab on the Load button click. This is the following code I have tried to use.

[Code]...

The Wafer_Info.Enabled = True is used to enabled all of the controls on the Wafer tab and works properly when the button is clicked. I have tried using .Focus() and .Show() to bring focus to the next tab but I am not have any luck getting to switch.

View 3 Replies

Setting Focus On Next Row?

Sep 4, 2009

How to set focus on next row or how to find next row index. My first row is inserted but on second loop it overwrites the first row cell...

View 1 Replies

Setting Min And Max Input?

Oct 13, 2010

So I am working on a small program to take a given password and mess with it etc. I have coded everything to make it work the way I want except I can't figure out what I am missing to limit the input from 5 to 7 characters only. I have attached the entire solution in case anyone wants that.

'Variables
Dim oldPassword As String = String.Empty
Dim newPassword As String = String.Empty

[Code].....

View 4 Replies

Setting New Mailmessage From Name?

Dec 17, 2009

i am sending an email message from outlook using this method:

dim message as new mailmessage(from,to, subject, body)
mailclient.send(message)' mailclient is defined as an smtpclient

my from is "aaa@yahoo.com" (the mail is fiction for the purpose of demonstrating what i am doing)and this method works but I don't want the reciever to see that the mail is from aaa@yahoo.com, I want him to see that its from "Blacknight". In yahoo you can simply write [URL] <Blacknight> and this will work. how do i add a name to the mail in mailmessage?

View 2 Replies

Setting The X And Y Of A Point?

Apr 6, 2012

I have this code for placing food in my snake game, but it is not working. It says the structure 'system.drawing.point' has no default property.

Public Sub PlaceNewFood(Optional ByVal EmptyCell As Boolean = False)
Dim rng As New Random
Dim fx, fy As Integer

[Code].....

View 5 Replies

Setting Up A Connection To The DB?

Jul 16, 2009

I'm having trouble setting up a connection to the DB.... When I go into VS 2008 on the left hand side (Server Explorer), I right click on the "Data Connections" option and select Add Connection and get the following error:

"The Microsoft.VisualStudio.Data.Interop.IVsDataProviderManager service could not be found."

View 2 Replies

Setting Up A Program In VB?

Jun 18, 2012

I have a little problem with setting up a program in visual basic, could you help me out ? This is what i want to do.. I have no ideea on how to make the form in form thing..

View 2 Replies

Setting Variable On .NET From A VB6?

Feb 23, 2011

i am developing this program in .NET (2010) and i connect on a form in VB6 using this code;

Dim P As New Process
P.StartInfo.FileName = "PathAndNameofVB6App"
P.WaitForExit()
P.Start()

now, how can i set a global variable that is accessible from my VB6 form to .NET(2010)?A little detail:VB.NET calls VB6 frmLogin then if Access Grant, x = 1, Exit() then VB.NET stores the value of x into database.

View 3 Replies

Reading / Setting Archive Bit

Mar 12, 2010

I just need to set the archive bit on a file. I see the archive attribute in the FileInfo object which I would think allows me to read the state of the bit, but I'm not sure how I would actually set it.

View 2 Replies

Restore Setting To Default?

Nov 27, 2009

i want to restore VB setting to 1st-time-use setting. i spend a long long time looking for default button in VB.But i cannot find anything .

View 1 Replies

Where Is Setting To Use Un-docked Forms

Apr 4, 2012

Just opened the VS2010 pack I've been meaning to get round to for ages. Where is the setting to use un-docked forms in the de?I know I can un-dock each for manually but thats pants.

View 6 Replies

.net - Setting Focus On The Parent?

Jan 6, 2010

I want to unfocus(leave) the texbox when I click on the usercontrol/form(focus the usercontrol/form instead): I do the following on the UC/form:

Protected Overrides Sub OnMouseClick _
(ByVal e As System.Windows.Forms.MouseEventArgs)
MyBase.OnMouseClick(e)
Me.Focus()
End Sub

Why does it not work on the child textbox, but works very well on the non-child one(focus on textBox2 then click on the panel removes the focus from the textBox2)?

View 4 Replies

.net - Setting The Hyperlink Value To A Datagrid In Asp.net?

Oct 8, 2011

I have a datagrid that is being populated by DirectoryInfo. The columns are Name, Date & Size. The Name value is a hyperlink.

[Code]...

View 1 Replies

Asp.net - Boolean Not Setting Properly?

Mar 3, 2011

I have the following code in an Asp.Net user control:

Me.pnlAddComment.Visible = MyBase.Associate.IsAgent()
Me.lblRating.Visible = Me.pnlAddComment.Visible
Me.Rating1.Visible = Me.pnlAddComment.Visible

Now when I run this code, the value of MyBase.Associate.IsAgent() is true. Yet at no point is Me.pnlAddComment.Visible evaluating to true. When I output the results as Response.Write statements, it shows IsAgent = True, pnlAddComment.Visible = False. When I run it in debug mode, placing the line break on the second line above to allow the set to occur: I put the mouse over IsAgent and it displays "True"; I put the mouse over pnlAddComment.Visible and it displays "False".

A Co-worker suggested that it's possible that it's Panel.Visible black box code in the getter that allows the assignment to occur but returns false because some parent object is set (at that point in the code execution) to False. I've reviewed the parent objects and at no time do any of them appear to be set to not visible.

If this were a reference type I might be convinced that some other process is modifying the reference between this assignment and when it is actually used (at Render), but this is happening right at this line of code.What would cause this boolean assignment to behave this way without throwing an exception?

Solution:The answer turned out to be a parent object in the control hierarchy located outside of the user control itself. Since nothing was explicitly set to false, and I agreed with @Shadow Wizard, @Damien_The_Unbeliever and @CodeMonkey1 that it had to be some outside control influencing the panel at that point, I decided to put a recursive while loop to test the parent of each user control in the hierarchy at that point:

Dim o as Object = Me.pnlAddComment.Parent
While o IsNot Nothing
Me.lblMessage.Text &= "<br />" & o.ID & ": " & o.Visible.ToString()
o = o.Parent
End While

Then I just ran this on the server and the output came back with the full visibility of each control in the chain. What ended up occurring is that this control was contained within a view control within a MultiView. This view control is expected to be visible as it is supposed to be the ActiveView for this particular call, but at the point in the life cycle when my code is run, the view has not been identified as the active view. Since it's not officially active, the view is implicitly false, and all child controls return a value of false when Visible is queried.

The rest of the assignments behave as expected from that point. The lblRating control is set to false (permanently) because at that moment the proper visibility setting for pnlAddComment is false. The lesson I've learned here is not to make control visibilities dependent on each other in this fashion when there is an alternative (and just as simple) method.

View 3 Replies

Asp.net - Setting Up A Custom Pre-processor In IIS?

Apr 23, 2012

I am looking at developing a pre-processor and wanted to know how to configure IIS to pass the requesting page to it before it is returned. For example, the user would navigate to a page with a ".app" extension and IIS would send the file to a console program I wrote to be interpreted, before sending the page back to the user.

View 1 Replies

ASP.NET Setting A Path For File With VB?

May 30, 2011

So this is a pretty dumb question, and one I am clearly misunderstanding for whatever the reason. I have an ASP.net project and the default aspx page loads a file. I made a class to deal with file handling, in it I hard coded the local directory to where that file is. I want to make that path relative to the default.aspx page. I can't figure out how to do that. I have read a lot of stuff on MSDN, and it makes simple sense, but when I put it to code I can't seem to get it right.

I feel my answer is here, I understand what it is saying but I can't translate that to my program.[URL] Code such as

Dim rootPath As String = Server.MapPath("~")

makes sense to me but I can't use 'Server' for some reason.

I have used this spot of code to supplement my problem for now.

string=System.AppDomain.CurrentDomain.BaseDirectory()

View 1 Replies

ASP.NET Setting Culture With InitializeCulture?

Mar 8, 2010

I have a website with three domains .com, .de and .it

Each domain needs to default to the local language/culture of the country.
I have created a base page and added an InitializeCulture

Protected Overrides Sub InitializeCulture()
Dim url As System.Uri = Request.Url
Dim hostname As String = url.Host.ToString()

[Code]....

But of course the InititalizeCulture then overrides whatever button selection has been made. Is there any way that the InitialCulture can check whether a button click has occurred and if so skip the routine?

View 3 Replies







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