|
Rewrite your app to include multithreading support. It's not something that can just be "turned on" with a switch.
Your application must be able to have parts that that run concurrently. For instance, breaking up a problem and having two threads each work on a seperate part of it. Or, in the case of say, a telnet server, one thread handles one client connection and another threads handles another.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Oh, i though it was as simple as turning a switch on with a special syntax in my code or a parameter in the compilation command.
So, you're saying that mi app will automatically detect 2 threads in my code and run each thread with a different processor?
In that case i should play a lot with System.Threading
|
|
|
|
|
No! You have to write your code to support multiple processors! Your code must be written to create it's own threads where appropriate. There is nothing that will do this for you.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Ok, i'll write my own threads inside my code.
System.Threading namespace is the way to go?
Do i have or can i specify wich processor should handle my thread?
|
|
|
|
|
Hi again, i've been surfing the net for a bit help and found code samples referring our topic in intel's site.
They use System.Threading for creating new threads (they have code that uses 4 different threads) but how do i know if these threads are handled by diferent processors? cause in the code they don't specify a processor to handle the thread and there's the possibility that a single proc may be running all the threads, how can i specify wich proc to handle threads?
Or my pc finds a thread and runs it with a processor and when my pc finds a second thread it runs it with the other proc?
Thanks for your help.
Sorry if i'm slow learning.
|
|
|
|
|
Heinz Suez wrote:
but how do i know if these threads are handled by diferent processors?
You don't! The system schedules which processor is going to handle which thread. Threads can even be moved between processors. 99% of the time, you really wouldn't have a reason to manually set the processor affinity. but, if you want to take a look at it, ProcessThread[^] in the System.Diagnostics namespace is what your looking for. Be sure to check out the ProcessorAffinity property.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanx man for your help, i got it all clear now.
|
|
|
|
|
Hi
I have a structure similar to this:
<root>
<item />
<eq>
<elems />
<elems />
<elems />
</eq>
<item />
</root>
how can I change it to this:
<root>
<item />
<elems />
<elems />
<elems />
<item />
</root>
I need to move all the children and delete the parent, but i can't figure out how to do it. What do I need to do??
cheers
-- modified at 11:49 Sunday 18th September, 2005
|
|
|
|
|
Please re-post. Cant see anything.
Live Life King Size
Alomgir Miah
|
|
|
|
|
|
|
I have an MDI app with several child forms. The MDI form has a MainMenu control on it. My child forms also have MainMenu controls. By Windows defaults when a child form is opened in the MDI, the childs MainMenu is added to the MDI parents MainMenu.
How can I prevent this? I want the MDI forms MainMenu left alone. I need the child forms MainMenu controls to appear on them and not be merged with the parent MDI.
|
|
|
|
|
Well I found a solution for this. I wrote my own menu control. It works great so far and gives me more enhancement options then the standard Windows MainMenu.
In your face Microsoft standards.
|
|
|
|
|
I try to launch an application that uses CsGL (OpenGL wrapper for C#). I downloaded CsGL pack and set the reference to csgl. I still get following errors:
using CsGL.Basecode ->this is invalid, he cant find it
Type or namespace 'Model' cannot be found -> where is it, where to get it?
thank you very much for any help
|
|
|
|
|
Hi
How can I change the order of child nodes in an xml document? (.NET 2)
cheers
|
|
|
|
|
I’d like to ask you a question: there are a lot of web sites made in static HTML. Sooner or later HTML sites are to be converted in PHP/MySQL, but the operation is very expensive since it is to be done manually or with the usage of ad hoc written software.
I’ve an idea to make an universal software to convert html pages into templates and database…
It’s really easy: it’s enough to compare two HTML files and make one regular expression that matches them. Then you refine that regular expression to match a group of files.
Example.
First file
1
Second file
2
Reg exp = \d
Third file
Reg exp = \d?
Fourth file
11
Reg exp = \d(0,2)
Fifth file
error
Reg exp = .*
|
|
|
|
|
And the question is?
---
b { font-weight: normal; }
|
|
|
|
|
Is it possible to make a software that compares two or more files that gives a regular expression that matches them all?
|
|
|
|
|
Yes, of course it is.
The question is rather if the pattern will be good enough to be useful for anything.
---
b { font-weight: normal; }
|
|
|
|
|
I think it depends from the number of file you can compare. However for web it would be enough to create a very very simple regular expression: .* (or better .*?) for any difference and the string itself for any identity between files.
example:
file 1:
1
file 2:
2
Reg Exp:
(?nome1 .*?)
Is it possible to do something similar modifying code from program that compare differences between files?
|
|
|
|
|
Yes, perhaps.
You should do something to normalize the pages before comparing them, also.
For an example, these codes:
<html><head><title>page</title></head>
and
<HTML>
<HEAD>
<TITLE>page</TITLE>
</HEAD>
They have the exact same meaning (at least in html, but not in xhtml), but most of the characters differ, and the white space differs.
---
b { font-weight: normal; }
|
|
|
|
|
yes this should be easy, but not so effective since there are a lot of other "invariants" in html language, and not so needeed since page in static html should be very similar each other.
It could be implemented by separating html tags from its content trimming each line of the resulting array of strings. html tags could be converted to little case.
|
|
|
|
|
hi,
i want to write a encrypted value ("1", "2",...)to the registry! but how can i encrypt and decrypt? which algos can i use RSA or smth. like that?
cu
|
|
|
|
|
Do a search on code project for encryption. This is the first hit http://www.codeproject.com/dotnet/SimpleEncryption.asp[^]. It looks like it gives an introduction to the encryption tools built into the CLR. Some of the other results look good as well.
I can imagine the sinking feeling one would have after ordering my book,
only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon
|
|
|
|
|
The best encryption there is, they actually use in banks, is this one:
To encipher:
out = in^cipherkey mod range
To decipher:
out = in^decipherkey mod range
Here's one key you can use:
7, 23 (or 13 I can't remmember)
If you don't got the key it's undecipherble!
Niklas Ulvinge aka IDK
|
|
|
|