|
Does anyone know how I can loop through a collection and start a thread to process each item in the collection, but I want to limit the number of threads running at a time to the number of cores on a PC.
Regards
|
|
|
|
|
im_hoser wrote: but I want to limit the number of threads running at a time to the number of cores on a PC.
I've always found this to be pointless. How many threads are already running system-wide before your app even starts?? 10? 50? Try over 200. So, whats another thread going to matter? Why limit your threads to 2 or 4?
|
|
|
|
|
I share your view Dave, unfortunately I cannot override my management. With that said have you come across this problem? How did you solve it?
Regards
|
|
|
|
|
im_hoser wrote: have you come across this problem? How did you solve it?
Only in a thought experiment. But, you can get the processor count from
Environment.ProcessorCount . You can then create your own threads and set their ThreadAffinity to get them to try and run on a particular processor if you want.
|
|
|
|
|
I found where to get the processor count. The trouble I'm having is creating a loop to process items in a collection from a thread and limiting the number of started threads to the number of cpu's. Lets say I have a thousand items in a collection and a dual core processor. I only want to start 2 threads at a time to process the thousand items until completed .
Regards
|
|
|
|
|
Hi guys
I am getting a soap exception in creation of a site in wss , this is
the following code.
Dim siteURL As String = "http://servername:4000/sitename"
Dim siteTitle As String = "TestSite"
Dim sitedes As String = "Site for testing"
Dim lcid As Integer = 1033
Dim SiteTemp As String = "STS#2"
Dim adminService As New AdminSer.Admin()
adminService.Credentials = New Net.NetworkCredential("admin", "pass", "workgroup")
adminService.CreateSite(siteURL, siteTitle, sitedes, lcid, SiteTemp, "workgroup\admin", "adminName", "", "", "")
Not sure what is happening, any inner exception is nothing.
Any pointer is appreciated.
Thanks
|
|
|
|
|
...and the Exception would be ____??????
|
|
|
|
|
I want to download data from an URL, i've tried all methods but can't find how to use this URLOpenStream Function...
Can anybody help me...
Tnx
|
|
|
|
|
|
I have a 32bit application built on vb.net2003 that uses the bundled crystal reports.
It installs and runs flawlessly on XP platforms.
when I install it on Vista Business (x64), the app runs fine, but any attempt to generate a report (that is, to instantiate a derived report class, as in, "dim rpt as new rptWhataver") results in
Cannot find KeycodeV2.dll, or invalid keycode.
keycodev2.dll is in fact present, and the app was built properly with the keycode property.
again, this app, and the reports work fine in about 1000 locations around the world on XP, win2k, and (gasp!) win98se. Anybody have a suggestion or work-around?
rani
|
|
|
|
|
I think I already answered this.
|
|
|
|
|
Do NOT repost the same question over and over. You just posted this 5 hours before. Show some patience. You're not paying for support here, and we all volunteer our time to answer questions. But, we answer them on OUR schedule, whenever we can spare the time, not on YOUR schedule.
|
|
|
|
|
Dup question...it's a habit of his.
|
|
|
|
|
Hello every one
Can some one plz help me with example of table locking. Wat i want to achieve is to lock the table for the time user one is doing read immediately followed by a update. If user 2 access the table he should be able to do so after the user1's operation is over
I am using datareader to read data.
Regards
Nishkarsh
|
|
|
|
|
Table locking is not what you are looking for. What you should use is a transaction.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Table locking is only for very specialized circumstances. Locking antire tables severely limits your app's scalability and increased administraive overhead. Think about it. If you app locks a table, then crashes, what do you do?? The lock doesn't clear itself...
|
|
|
|
|
Good Afternoon All
Am Overriding the Paint Method. i need to Change Colour based on the Value of a Certain Column. The Following Code Will Look for that Value in Every Column and Change the Colour in those Cells.
Dim o As Object<br />
o = Me.GetColumnValueAtRow(source, rowNum)<br />
If (Not (o) Is Nothing) Then<br />
Dim c As Char<br />
c = CType(o, String) '.Substring(0, 1)<br />
If (c = "True") Then<br />
' could be as simple as<br />
' backBrush = new SolidBrush(Color.Pink);<br />
' or something fnacier...<br />
backBrush = New LinearGradientBrush(bounds, Color.FromArgb(255, 200, 200), Color.FromArgb(128, 20, 20), LinearGradientMode.BackwardDiagonal)<br />
foreBrush = New SolidBrush(Color.White)<br />
End If<br />
End If
How can i change the Change the Entire row based on a Value in a Certain Column
Thanks
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
Since you are talking about columns and rows, are you using a DataGridView? If so, you want to look at handling the CellFormatting (http://msdn.microsoft.com/en-us/library/z1cc356h.aspx[^]) event. A DataGrid also has a similar event, try looking at this article[^] for more details.
Scott.
—In just two days, tomorrow will be yesterday.
—Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
[ Forum Guidelines] [ Articles] [ Blog]
|
|
|
|
|
I would like to take a chance to thank you for your help,
Everything is working Fine
Thanks
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
Hi,
i have converted my application from VS 2003 to VS 2005 i am gettnig the error:
"PInvokeStackImbalance was detected
Message: A call to PInvoke function 'Senturion!SenturionFlash.KernelInterfaces::SetIssueEvent' has unbalanced the stack. This is likely because the managed PInvoke signature does not match the unmanaged target signature. Check that the calling convention and parameters of the PInvoke signature match the target unmanaged signature."
i am using Vb.Net windows application.
Mohammad Al Hoss
|
|
|
|
|
If it's a Win32 API you are calling, try looking up the function on http://pinvoke.net/[^] and make sure that you declared it correctly.
Scott.
—In just two days, tomorrow will be yesterday.
—Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
[ Forum Guidelines] [ Articles] [ Blog]
|
|
|
|
|
You Declare 'd the function incorrectly. Mostly this is because someone used the oold VB6 declare and tried to use it in VB.NET without knowing how the basic data types work. A Long value (32 bit signed integer) in VB6 is the same as an Integer in VB.NET. In VB.NET, a Long is a 64 bit signed integer. If the function you call pushes a 32 bit value on the stack and your code pops 64 bits off, you just imbalanced the call stack.
|
|
|
|
|
Hi,
your problem probably relates to the calling conventions (things such as CDeclSpec,
StdCall). Make sure your native code and the DllImportAttribute.CallingConvention
in your managed code are agreeing; I suggest to make them both explicit, i.e. not
to rely on default values here.
|
|
|
|
|
hi im making this program that can make a screenshot of the active window (alt+printscrren) and then see what color there is in a specifik X,Y cordinate. i made a program that can take the screenshot in vb.net but i only know how to take the cordinate color with C# so do any know how to eather make a screen shot of a active windoe with C# ore see a cordinate color with VB.Net??
|
|
|
|
|
Can't you translate the C# to Visual Basic? Just re-arrange some stuff, remove some semi-colons, and then cheat with this page[^].
|
|
|
|