|
PIEBALDconsult wrote: static methods are thread-safe, right?
yes, if the documentation for a particular class says so. Otherwise no.
The typical .NET class does that, as you well know.
|
|
|
|
|
I found this interesting piece on the msdn site -
"A call to a static method generates a call instruction in Microsoft intermediate language (MSIL), whereas a call to an instance method generates a callvirt instruction, which also checks for a null object references. However, most of the time the performance difference between the two is not significant."
This is contrary to the belief that static methods can improve performance in certain situations.
So I suppose it's just a matter of usage really.
|
|
|
|
|
Abhinav S wrote: This is contrary to the belief that static methods can improve performance in certain situations.
Why contrary? Sounds like it says static methods are faster. Granted the difference is not significant most of the time (i.e., it is significant some of the time).
|
|
|
|
|
when is that local variables are created and destroyed ,C#?
thanks.
|
|
|
|
|
You really need to buy this book[^] and read it. The point of the forums is not to teach people the basics of the language - the forums are here to help people with specific problems they may have.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
What difference does it make?
|
|
|
|
|
it may be important when a method needs huge amounts of local variables: it may work well when they get allocated and freed by the smallest code block that contains them, it may throw a StackOverflowException when all of them get allocated upfront.
|
|
|
|
|
Luc Pattyn wrote: when a method needs huge amounts of local variables
Refactor?
|
|
|
|
|
Isn't that going to use more stack space? Return addresses, and so forth...
I have learnt that you can not make someone love you, all you can do is stalk them and hope they panic and give in.
Apathy Error: Don't bother striking any key.
|
|
|
|
|
Yeah, well, you could delegate some data to local variables in a different method, executed by some other thread. So basically implement an in-stack database, using Invoke to call on a single GetSet() method. But then that may be over-engineering the situation a bit.
|
|
|
|
|
Would be a nice answer to stump his teacher and set a new bar for homework, though
I are Troll
|
|
|
|
|
Remind me to suggest it at the next code review...
I have learnt that you can not make someone love you, all you can do is stalk them and hope they panic and give in.
Apathy Error: Don't bother striking any key.
|
|
|
|
|
I need some quick direction, how to - overview. I am relatively new to C# and Windows Form Programming but excited and interested in consuming everything I can. I need some direction for my research and design.
I have a panel control.
Within the panel control I have 4 Text Boxes, a DataGridView, a few labels etc...
I have an xml file source.
I have a main source windows form.
I want to have a drop down box on the Windows Form that has a list of items from the xml file.
Once I select the item from the down box I want to copy (instantiate) the panel with all of the controls within the panel, and then populate them with the rest of the data from the xml dataset already loaded.
I have done all of the code up to the instantiating and copying the panel with its controls...
Is there a better way to do this? keywords i can research, a little direction would be so helpful! Thanks!
|
|
|
|
|
List the three ways that data can be transmitted within the parameters provide the associated keywords.in C#
thank you.
|
|
|
|
|
toto_2010 wrote: List the three ways that data can be transmitted
Telephone
Telegraph
Tell-a-mother-in-law
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
That was a trick question. There are many more ways:
Telex
Tell-ex-wife
...
|
|
|
|
|
List three ways you can get your homework done without asking in a forum.
|
|
|
|
|
.Write
.WriteLine
Left as an exercise.
|
|
|
|
|
Backwards.
Forwards.
Sideways.
Hope this post was as helpful as much as your question was not a homework assignment!
Dalek Dave: There are many words that some find offensive, Homosexuality, Alcoholism, Religion, Visual Basic, Manchester United, Butter.
Pete o'Hanlon: If it wasn't insulting tools, I'd say you were dumber than a bag of spanners.
|
|
|
|
|
How about
Over, under, sideways, down, backwards, forward, square around (The Yardbirds).
Regards
David R
---------------------------------------------------------------
"Every program eventually becomes rococo, and then rubble." - Alan Perlis
The only valid measurement of code quality: WTFs/minute.
|
|
|
|
|
1) Sexually
2) Asexually
3) Radiation (prevents 1 & 2 working properly)
I have learnt that you can not make someone love you, all you can do is stalk them and hope they panic and give in.
Apathy Error: Don't bother striking any key.
|
|
|
|
|
tricky question... indeed... but I can think that if you want to transmit data in C#, even before starting you need to make sure you have a computer connected to a network (can be internet), and the only way I think you can transmit data over is with TCP packets... isn't that a little advanced for homework???
I want to die like my grandfather- asleep, not like the passengers in his car, screaming!
|
|
|
|
|
Hi to all
I want to make a dynamic report with crystal Report that i can choose column to show and change location of column
how can i do it ? (please give me an example)
|
|
|
|
|
hey all,
I wrote some typing application, which uses some data stored in the txt file.
is there any way to stored data not in txt file ? (the data is english dictionary)
because txt file is editable/readble.
thanks
modified on Friday, May 7, 2010 10:09 AM
|
|
|
|
|
Loads of them - how complex do you want to go? How is your data arranged?
You should never use standby on an elephant. It always crashes when you lift the ears. - Mark Wallace
C/C++ (I dont see a huge difference between them, and the 'benefits' of C++ are questionable, who needs inheritance when you have copy and paste) - fat_boy
|
|
|
|