Originally Posted by sparkvolt
Hey there Master!
Nice set of tutorials for "Idiots". I believe myself to be an utter idiot and moron and watched all your videos!
So, me being an Idiot and all that, I do have some interesting questions and was wondering if your royal uberness can answer them for me? Ready? Ok, here we go... Hoorah?
What is boxing and unboxing? I always wanted to kind of know that. How boxing and unboxing affects performance? You being very good in .NET I thought I ought to ask you to explain this concept for me.
Boxing moves something from the stack (value-type) to the heap (reference) as an object, unboxing moves something from the heap to the stack as a valuetype
What is difference between Mutex, Semaphore, Lock, etc? Why should I use one over the other? Or better yet, what are they used for anyway? What is deadlock and what is spin-lock? What is race condition? I am really eager to know this...
You should use lock, because if anything unexpected happens your object is still unlocked. They're using for thread synchronization, for instance, if you need to make sure your operation is completed before another one takes place (i.e. you can't having adding and removing taking place in a collection at the same time, so when adding you must lock the collection so that removing can take place only after the add is complete, or vice-versa) dead-lock is when a thread tries to access an object thats been locked by another thread permently thus causing a thread-block and a critical error in your application, I'm not sure what spin-lock is.
Are collections thread-safe? Not all. If so, in what manner? What is fastest collection class? Depends what kind of collection you want Why generics are important Microsofts poor attempt to make a simple version of C++s Template and why should I use generics over non-generics? If you can use a non-generic, then do so. Can I use generics for programmable polymorphism? Yes. Can I use C# generics for template metaprogramming much like C++? Possibly, depends how your using it.How about loop unrolling? Not sure what that means
What is Marshalling? The best way I can explain this is converting on object to another (for instance C# marshals the string class to the C++ char* or w_chart* for certain pinvokes)
Now to get to a little bit lower level of things, what are some advantages of using raw Winsock2 vs. Socket and Net namespace? .NET preforms a bunch of gay checks when calling their methods, if you know how to winsock you'll probably beable to make a better wrapper to suit your purposes What are benefits of doing raw Winsock2 handling? Do you prefer blocking or non-blocking operations? non-blocking If you prefer non-blocking operations, what are some methods you use to implement non-blocking calls to Winsock2 API? Run your method in the new thread, or if you need to check if a socket has data call 'select'
Do you use Overlapped I/O? Do you know much about Overlapped I/O? What about I/O Completion Port a.k.a IOCP? Can I build IOCP in C#? Does Microsoft implementation of Socket perhaps use IOCP for Begin___ operations? Why is Microsoft implementation slow? I'm not sure about any of this
What are co-routines, protothreads, microthreads, and fibers? Can I use or implement those in C#? How can I implement them? If not, what prevents me from doing it? Does threading in .NET happen at user level or does it reach kernel level? Not sure what you mean, never delt with this
What is the context overhead for task switch? Why is context switching costly operation? Dunno what your talking about
What is co-operative multitasking in comparison to pre-emptive multitasking? How can a program benefit from one or the other?
Lastly, if I have more questions, I would love to come to you, if you can please answer these for me.
Please answer me, Master Genius Programmer/Developer, I want to implement kick ass server, I just need few *pointers(pun intended) in the right(->) direction... Haha
Sincerely,
-spark
|