Gopi Krishna Komanduri wrote:
> Hi,
>   I need a small example on thread safe . I mean how to do thread safe when 
> two threads are  accessing the same memory block.
> Do we use events and mutex for this , if so, May I know how?
> 
> Please clarify.
> 
> Thx,
> --Gopi

If you are only going to be accessing data intraprocess (i.e. threads in 
the same process but NOT threads between two different processes), then 
you only really need critical sections:

http://en.wikipedia.org/wiki/Critical_section

Critical sections are significantly lighter-weight than mutexes under 
some OSes (i.e. Windows).

-- 
Thomas Hruska
CubicleSoft President
Ph: 517-803-4197

*NEW* MyTaskFocus 1.1
Get on task.  Stay on task.

http://www.CubicleSoft.com/MyTaskFocus/

Reply via email to