Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Blog | Linux Links | Bling | About BLU

BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Shared Memory SYS V



On Mon, 20 Sep 2004 08:47:50 -0500 (EST)
Anthony Gabrielson <agabriel at home.tzo.org> wrote:

> Hello,
> 	I'm going to preface this question with its homework...  I'm 
> looking for some good examples of shmat with threads on the web. 
> Either that or a good explanation.  I need to use it in homework, and
> I will be away on a business trip the night its discussed.  So if
> anyone has a good example or a good explantion of how to use it with
> its tools I would appreciate it.
You are talking two different things. shmat(2) is one of the shared
memory system calls. Normally, one would use semaphores (semop(2)) to
protect access to a shared region. 

Threads is a different animule. POSIX threads use mutexes to protect
access to shared memory. However, using a mutex to protect a shared
memory object (shmat(2)) only provides protection from multiple threads
in the same process where semaphores are used between processes.
Additionally, threads would share memory defined locally within the
process. 

I've used both shared memory (shmat(2)) and threads. I've also used
fcntl locking as a protection mechanism.


-- 
Jerry Feldman <gaf at blu.org>
Boston Linux and Unix user group
http://www.blu.org PGP key id:C5061EA9
PGP Key fingerprint:053C 73EC 3AC1 5C44 3E14 9245 FB00 3ED5 C506 1EA9
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.blu.org/pipermail/discuss/attachments/20040920/3b1659f0/attachment.sig>



BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org