|
www.learnvisualstudio.net....is a great website to begin for begineers
|
|
|
|
|
Im new to multi-threading i have a list of files that need to be processed (the method to do this has been tested and is working) but its a cpu and hdd intensive one .
At the moment i have a Parallel.ForEach loop and ive tried setting ParallelOptions.MaxDegreeOfParallelism = 2 and even one but regardless the loop runs out if control and starts running the method multiple times instead of just twice without waiting for the method to finish
Im not getting any exceptions, Should i be using this or another loop ?
|
|
|
|
|
Rohit Dubey from Hyderabad wrote: (the method to do this has been tested and is working) but its a cpu and hdd intensive one
I have a feeling multithreading is not going to help if the method is extremely io intensive, that will end up being your bottleneck.
"I have a theory that the truth is never told during the nine-to-five hours. "
— Hunter S. Thompson
|
|
|
|
|
Rohit Dubey from Hyderabad wrote: its a cpu and hdd intensive one
It is one or the other. When running in a single thread either the calculations or the disk transfers are the limiting factor, it won't be them both. If it is the disk, multi-threading won't help you; if it is the CPU, then it would, when done properly.
And if you need lots of locks and/or Control.Invoke() stuff, chances are you won't gain anything.
|
|
|
|
|
i want to start C# but i don't know what book is better.please help me. and tell what book is better for a beginer. and The link for free download.
|
|
|
|
|
Seriously, you need to stop asking questions like this here. Don't compound the error by asking for a free download of a (presumable not free) book.
Google for c# beginner's tutorials: they'll do you far more good than any book at the outset.
|
|
|
|
|
Everyone learns in different ways. You need to go to Amazon, read the reviews and work it out for yourself.
If you want free try Learn Visual C#[^]
"You get that on the big jobs."
|
|
|
|
|
Try to found Balagoswamy C# book, its a core c# book available in the market
If you have any problem in c# contact me on my mail
Thanks
Kumar Ashish
|
|
|
|
|
|
sir actualy i am passing one form reference in constructor to use its control in another form but i am not getting the control of first form in second form .......
please provide some solution
|
|
|
|
|
Although it is hard to guess without seeing your code, I think that the most probale reason is, that the control in question is private. So, to access the control from the second form, just set the control to public or provide public accessor in the first form.
|
|
|
|
|
That doesn't sound like a good way to do it. You likely want the second form to have an event and have the first form register a handler for that event.
|
|
|
|
|
See my article on events here[^] for a better method than constructor injection, in particular the section "Form Communication Using Events".
|
|
|
|
|
BasePriority = 'process.BasePriority' threw an exception of type 'System.InvalidOperationException'...This is the exception I am getting while restoring the database from my .net application..Here I am providing the code....
try
{
string path;
path = filetext.Text;
StreamReader file = new StreamReader(path);
string input = file.ReadToEnd();
file.Close();
ProcessStartInfo psi = new ProcessStartInfo();
psi.FileName = @"C:\Program Files (x86)\MySQL\MySQL Server 5.0\bin\mysqlimport.exe";
psi.RedirectStandardInput = true;
psi.RedirectStandardOutput = false;
psi.Arguments = string.Format(@"-u{0} -p{1} -h{2} {3}",
userid, paswd, server, comboBox1.Text);
psi.UseShellExecute = false;
Console.WriteLine(psi);
Process process = Process.Start(psi);
process.StandardInput.WriteLine(input);
process.StandardInput.Close();
process.WaitForExit();
process.Close();
MessageBox.Show("database is restored");
}
catch (IOException ex)
{
MessageBox.Show("Error , unable to Restore!");
}
Plz provide any suggestion....
|
|
|
|
|
You cannot set the BasePriorty as this is a read only Property.
The return type of this property is an integer. Read more about this here[^] .
You have not provided the code for this statement, so its hard to figure out what you were trying to do.
|
|
|
|
|
|
As pointer reach to line Process process=process.start(psi), command line windows opens for a second and then closes and when after this line I watch the output it throws that exception that process has existed....
|
|
|
|
|
Yeah, I don't see such a statement, but maybe you need something like this:
try
{
process.PriorityClass = System.Diagnostics.ProcessPriorityClass.BelowNormal ;
}
catch
{
/* The process probably already exited due to error */
}
|
|
|
|
|
yes sir process is already exiting due to error .........i am also unable to understand why the process is exiting ...give some solution thanks
|
|
|
|
|
You'll need to check the output. You may need to redirect and capture the output.
|
|
|
|
|
how i can do this ....provide what code i should use or steps to do that thanks in advance
|
|
|
|
|
You can print reports that personal information, now I hit the print icon in the report and display the print dialog box has two buttons ok and cancel, if you click ok it will print, but how do you know that have hit the ok button? Thank you very much.
|
|
|
|
|
Try:
PrintDialog pd = new PrintDialog();
if (pd.ShowDialog() == DialogResult.OK)
{
....
}
BTW: Please do not post subjects in Vietnamese (or other languages) - most readers cannot understand it, so you reduce your chances of getting help. Google translate does a pretty good job:
Bắt sự kiện nút ok của hộp thoại print
Getting event print dialog's ok button
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
|
|
|
|
|
Hi , have a good day ,
I have Paired Nokia Mobile with my PC Windows 7 64 bit , through bluetooth
And Every thing works fine , Contacts , Messages , File Transfer ,
Even after I restart My PC or Turn my Mobile Bluetooh off/On , they connected Automatically ..
Except , one thing the "Telephony Audio Gateway!"
It does not Connect automatically , I have to press Connect Button from my PC Bluetooth settings , every time they connected again !
Setting Picture[^]
Thank you .
|
|
|
|
|
What does this have to do with C#?
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|