473,322 Members | 1,259 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Question in C# and Assembly

Hi All

I have following questions regarding C# Assembly and Threading.

Let me know the precise answer or lead me to the proper materials.

1. Is memory leakeage possible in .Net Manager Code ?
2. Is memory leakage possible in .Net Unmanaged Code ?
3. How can I find the what % of memory is being used by DLL at run time ?
4. What is difference between Sunchronous processing and Async
processing in .Net ? How can I achieve it ?
5. Can any one lead me towards Multithreading GUI development in Winforms ?
6. Difference between Delegate and Event ?
7. Is there any specific Design Patterns specifically for WinForms ?

Awaiting reply

Thanks

Silent Ocean
Nov 19 '05 #1
1 1260
Hi Silent Ocean,

You ask a lot! I'll give you a few answers.
1. Is memory leakeage possible in .Net Manager Code ?
Yes. Some .Net classes are wrappers for objects that must be released. Most
of these implement the IDisposable interface. A good rule of thumb is, if a
class has a Dispose method, make sure to Dispose it.
2. Is memory leakage possible in .Net Unmanaged Code ?
Of course, and easy to accomplish, if you aren't creful.. This is one of the
reasons that Managed Code was created.

A note about memory leaks: A memory leak occurs when memory is allocated by
an application and not released prior to the application shutting down.
Memory is allocated from the Operating System, and is locked by an
application. If the app fails to release the memory prior to shutting down,
the memory becomes unusable until the machine is rebooted. The .Net platform
manages memory allocation for you, with some exceptions as noted above.
3. How can I find the what % of memory is being used by DLL at run time ?
http://msdn.microsoft.com/msdnmag/is...ETProfilerAPI/
4. What is difference between Sunchronous processing and Async processing
in .Net ? How can I achieve it ?
Synchronous processing is sequential. A thread is a sequence of
instructions. They are synchronous because they occur in sequence, one at a
time. Multi-threading is the capability to spawn multiple independent
(asynchronous) threads. The threads execute independently, and at the same
time (sort of, more or less). Actually, the threads are not "synchronized"
in any way. So, they may execute at the same time, or they may overlap in
execution, or they may not. They are independent (hence, "asynchronous").

In fact, a computer can perform precisely one machine instruction at a
time. Multi-threading is achieved by creating a large loop in the operating
system process, which takes many side trips to perform multiple tasks, a
"slice" at a time. In the olden days, this was referred to as "time
sharing." Since computers perform instructions so quickly, it looks as if
the computer is simultaneously performing many operations at the same time.

The System.Threading namespace contains the classes you need to spawn and
manage threads. Be aware, though, that there is a level of complexity
introduced by multi-threading, which makes your job much harder to do. Once
you have a program performing multiple tasks independently, there are many
pitfalls to avoid, such as race conditions and deadlocks. For example, if
one thread is attempting to fetch a member of a Collection while another
thread is modifying the Collection, you should be able to see how this could
be a problem. Make sure and bone up on the issues before you jump into it!
5. Can any one lead me towards Multithreading GUI development in Winforms
?
I'm not even sure what that means.
6. Difference between Delegate and Event ?
An Event is a message that is sent to the operating system for broadcast to
any listeners for that Event (Event Handlers). A delegate is a reference
type that encapsulates a method, or more than one method. It is similar to a
function pointer, but is type sage, object-oriented, and secure. The
delegate definition defines a signature for the methods which that delegate
can encapsulate, or point to. EventHandler is a delegate. Delegates are used
for more than handling events, however. Since a delegate can point to any
method that matches its signature, and in fact, more than one method, a
delegate can be used as a sort of placeholder for some method that is not
defined at design time. For example, you can define a method that takes a
delegate as a parameter, and later, dynamically assign one or more methods
to that delegate when executing the method. This allows a method to perform
multiple types of operations.
7. Is there any specific Design Patterns specifically for WinForms ?
Not that I know of. However, you may find the following useful:

http://msdn.microsoft.com/library/en...asp?frame=true

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
The sun never sets on
the Kingdom of Heaven

"Silent Ocean" <si************@yahoo.com> wrote in message
news:ef**************@TK2MSFTNGP10.phx.gbl... Hi All

I have following questions regarding C# Assembly and Threading.

Let me know the precise answer or lead me to the proper materials.

1. Is memory leakeage possible in .Net Manager Code ?
2. Is memory leakage possible in .Net Unmanaged Code ?
3. How can I find the what % of memory is being used by DLL at run time ?
4. What is difference between Sunchronous processing and Async processing
in .Net ? How can I achieve it ?
5. Can any one lead me towards Multithreading GUI development in Winforms
?
6. Difference between Delegate and Event ?
7. Is there any specific Design Patterns specifically for WinForms ?

Awaiting reply

Thanks

Silent Ocean

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Marian | last post by:
Hi, I am totaly novice in .NET and I am studying a book about this. There was mentioned "assembly". I did not understand, how function does it has . I would like to know the exact run of code...
43
by: nospam | last post by:
I got three (3) files (1) Untitled.aspx (2) Untitled.aspx.1.cs (3) Untitled.aspx.2.cs These three files must be used together to make file #1, Untitled.aspx, page work via J.I.T. when the...
1
by: Mike Malter | last post by:
I am just starting to work with reflection and I want to create a log that saves relevant information if a method call fails so I can call that method again later using reflection. I am...
2
by: Dan | last post by:
Let's say I have a class like: class Dummy { public const string CONE = "one"; public const string CTWO = "two"; ... other stuff .... }
11
by: Random | last post by:
I'm confused about the proper use and usefulness of namespaces. I beleive I understand the purpose is so the developer can put classes within namespaces to essentially organize your code. And I...
10
by: jojobar | last post by:
Hello, I am trying to use vs.net 2005 to migrate a project originally in vs.net 2003. I started with creation of a "web site", and then created folders for each component of the site. I read...
29
by: Tiraman | last post by:
Hi, I Build my own dll with my own namespace name and i would like to put it in one place but for the project bin folder so all of the projects will be able to use it . i tried to put the dll...
45
by: Robbie Hatley | last post by:
Hello, group. I've been doing too much C++ programming lately, and I'm starting to become rusty at some aspects of the C way of doing things, esp. efficient low-level data copies. ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.