What is Thread ?(VC++)What is the difference between Cmutex and Csemaphone?

Showing Answers 1 - 5 of 5 Answers

Naveen Rao

  • Jan 11th, 2006
 

Thread is a light weight process which maintains its own stack and registers but can share the other resources allocated for the process.CMutex and Csemaphore both are used for thread and process synchronisation. CMutex can allow at the most one thread/process to access the resource that also mutually exclusively but Csemaphore can allow the access to the resource to a number of threads/processes simultaneously.

  Was this answer useful?  Yes

suresh

  • Jul 17th, 2006
 

Hi,

  Thread is the smallest set of instructions that can be executed..

   Cmutex and Csemaphore are the ways used for synchronization purpose.

 the difference between the above two is..Cmutex is a single lock where as csemaphore is  a multilock..

Manjunath.D.N.

  • Aug 6th, 2006
 

A very good site.

  Was this answer useful?  Yes

sivaprasad

  • Oct 25th, 2006
 

Hai,

Thread: is a path Execution of a program....So that the thread having its own stack,and all other resources..

In VC++ we have 4 synchronization Objects.

1)CCriticalSection: This is not aKernal object. using this object you can synchronize one or more threads with in the same process.

2)CMutex

3)CEvent

4)CSemaphore these three are kernal objects

using mutex you can sync two r more threads in the same process or diff process...

 

i hope u get little bit idea abt these objects

thanks & regards

Sivaprasad

  Was this answer useful?  Yes

Cmutex is the synchronization object to control access of a resource by multiple applications(one thread of each application to access the resource at a time).

CSemaphore is the synchronization object to control access of a resource by multiple threads of a process. CSemaphore allows to specify the number of threads which can process the resource at the same time.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions