Thread: Info about program execution

  1. #1
    Registered User
    Join Date
    Jun 2007
    Posts
    4

    Info about program execution

    Hello Gurus

    I need info regarding program execution.

    1. When we include libraries using the #include directive, will the entire library be included in the executable?

    2. How are libraries liked statically and dynamically?

    3. When a program is executed, should the data as well as the fuctions in the program be available on the memory(either normally or through paging)?

    4. Are dynamically linked libraries and shared libraries same? If not , what is the difference?

    Thanks in advance,
    Satya Prasad

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    > 1. When we include libraries using the #include directive, will the entire library be included in the executable?
    That depends on the quality of your tools. Good tools should only include in the executable the stuff you actually use.

    > 2. How are libraries liked statically and dynamically?
    Static linking is performed by the linker when you create the program
    Dynamic linking happens either
    - when the program is loaded
    - when a function in the dynamic library is called

    > 3. When a program is executed, should the data as well as the fuctions in the program be available on the memory
    They will be in memory at the point you reference them.
    Before and after, who knows the mysteries of your OS's paging strategy.

    > 4. Are dynamically linked libraries and shared libraries same? If not , what is the difference?
    Different terminology for what is essentially the same idea.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Jun 2007
    Posts
    4
    Thank you very much for the reply salem.. Sorry for asking.. is there a way to close a thread???

  4. #4
    Registered User ssharish2005's Avatar
    Join Date
    Sep 2005
    Location
    Cambridge, UK
    Posts
    1,732
    Quote Originally Posted by satya_nemana View Post
    Thank you very much for the reply salem.. Sorry for asking.. is there a way to close a thread???
    You cant close the thread. It can only be done by mod's. Why do you need closing a thread.

    ssharish2005

  5. #5
    Registered User
    Join Date
    Jun 2007
    Posts
    4
    Hi Harish.
    Closing the thread is actually this is a way to tell to the community that the author is satisfied with the answer so that others may not waste their time replying.. This can save a lot of time for the gurus.. who are otherwise very busy persons...

  6. #6
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    Unless we're curious to see why it was closed :\

  7. #7
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    Saying thanks at the end is quite sufficient.

    Besides, premature closure prevents others with better (or possibly more accurate) information from posting. Don't just take the first seemingly plausible reply from someone with a high post count as being a definitive answer

    Threads essentially close themselves when everyone stops talking, because the question has been answered. If an answer was wrong, people would dive in to correct it. If an answer was vague, you would ask for clarification, or provide more information to us.

    99% of people understand that the thread is done if they see that, though the occasional idiot will post some tripe a few years later (aka grave diggers).

    Other forums such as daniweb have a "marked as solved" feature, but its use is the exception rather than the rule. Even then, someone will chip in with their $0.02 worth many years later.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  8. #8
    Registered User
    Join Date
    Sep 2006
    Posts
    835
    > 99% of people understand that the thread is done if they see that, though the occasional idiot will post some tripe a few years later (aka grave diggers).

    Why can't locking threads after a fixed period of time be automated? Then it wouldn't be necessary to rely on people's judgment in this.

  9. #9
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    But what happens if you wanted to come back to it, for example you were going on holidays for a week or unable to respond...?
    Quote Originally Posted by Salem, the king of post counts
    Other forums such as daniweb have a "marked as solved" feature, but its use is the exception rather than the rule. Even then, someone will chip in with their $0.02 worth many years later.
    Often to increase their post count

  10. #10
    Registered User
    Join Date
    Sep 2006
    Posts
    835
    A month or two is probably long enough for anybody, especially nowadays when many people can go online easily even when away from home. Or the thread could be locked after a certain period for anyone except those who posted previously. There should be a way to automate this.

  11. #11
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    Since it's automated it'd require some sort of server intervention, (eg a cron job), and really is it worth the effort to set it up ?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Client-server system with input from separate program
    By robot-ic in forum Networking/Device Communication
    Replies: 3
    Last Post: 01-16-2009, 03:30 PM
  2. Issue with program that's calling a function and has a loop
    By tigerfansince84 in forum C++ Programming
    Replies: 9
    Last Post: 11-12-2008, 01:38 PM
  3. I need some help with my program please.
    By agentxx04 in forum C Programming
    Replies: 9
    Last Post: 09-26-2004, 07:51 AM
  4. program execution
    By xlordt in forum C Programming
    Replies: 4
    Last Post: 04-11-2003, 05:47 AM
  5. Program Execution
    By UnclePunker in forum C++ Programming
    Replies: 1
    Last Post: 03-27-2003, 10:07 AM