![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Threads and Threads Count ? | varungupta | UNIX for Advanced & Expert Users | 2 | 03-21-2008 09:23 PM |
| how to read POSIX? | robin.zhu | UNIX for Dummies Questions & Answers | 3 | 07-15-2006 10:07 AM |
| what can I get the posix standard? | crashsky | UNIX for Advanced & Expert Users | 2 | 02-12-2004 01:30 AM |
| Unix(posix) | Haris Astreos | High Level Programming | 1 | 11-10-2002 10:45 AM |
| ANSI C vs POSIX | bb00y | High Level Programming | 2 | 11-05-2002 09:20 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Are you asking if you create two threads, can they modify the same memory?
Yes. You prevent that by: 1. keeping almost all the variables they change declared local to the function. That way they cannot hurt anybody else's data. 2. For shared data, set up a mutex, so that only one function is able to change shared data at one time. In your case, if you pass a reference to int and char to both functions, then you have a problem. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|