Thread: sharing resources between programs

  1. #1
    Registered User
    Join Date
    Jan 2008
    Posts
    30

    sharing resources between programs

    Hi
    This question is related to Systems Programming

    Problem-
    Create a linked list with 5 nodes -
    Size of nodes 10K,20K,30,40,50K
    Assume node1 and node3 load with program 1 and 2 store the new program in the following size 60K.
    Using Best fit and first fit method.

    My doubts-
    1-How do u make a program access data in another program.( I know global vars come in somewhere but don't know how to link the programs )

    Any sort of help will be appreciated!
    cheers!

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Your question makes me ask two more questions to clarify what you want to do.

    1. What do you mean by a program. Is a program the same as an executable?

    2. What system is this supposed to run on? What compiler are you using?

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  3. #3
    Registered User
    Join Date
    Jan 2008
    Posts
    30
    I guess a program is code that is stored as a separate file and can be compiled independently.

    The system is Unix GCC compiler.
    thanks for ur interest.

  4. #4
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Well, if the "executable file" is a separate process, then to share it with any other process, you will need to use something called "shared memory".

    Here's a Linux link that shows some variants of shared memory; other Unix variants may have other implementations [although these two are the most common ones]:
    http://fscked.org/writings/SHM/shm.html

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  5. #5
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    Are you actually supposed to learn about shared memory, or is this just a really bad word problem for the knapsack problem? Somehow the latter seems more likely to me.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. false sharing confusion!!
    By mynickmynick in forum C Programming
    Replies: 4
    Last Post: 07-21-2008, 02:10 AM
  2. measuring system resources used by a function
    By Aran in forum C Programming
    Replies: 1
    Last Post: 03-13-2006, 05:35 PM
  3. Windows Programs Note Releasing Resources
    By bartybasher in forum Windows Programming
    Replies: 3
    Last Post: 08-04-2003, 09:14 AM
  4. POSIX/DOS programs?
    By nickname_changed in forum C++ Programming
    Replies: 1
    Last Post: 02-28-2003, 05:42 AM
  5. resources sharing resource
    By iain in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 01-06-2002, 10:42 PM