Re: pthread_lock

2013-03-12 Thread Prabhu nath
On Wed, Mar 13, 2013 at 9:40 AM, ishare wrote: > On Tue, Mar 12, 2013 at 06:18:02PM +0530, Prabhu nath wrote: > > I guess we should not mix mutex and condition variable. Both have their > own > > respective semantics. > > *mutex* is used to serialize access to a shared resource among competing >

Re: pthread_lock

2013-03-12 Thread ishare
On Tue, Mar 12, 2013 at 06:18:02PM +0530, Prabhu nath wrote: > I guess we should not mix mutex and condition variable. Both have their own > respective semantics. > *mutex* is used to serialize access to a shared resource among competing > threads. > *condition variable* is used to notify a* state

Re: pthread_lock

2013-03-12 Thread Prabhu nath
I guess we should not mix mutex and condition variable. Both have their own respective semantics. *mutex* is used to serialize access to a shared resource among competing threads. *condition variable* is used to notify a* state change* of a resource to the interested thread. In case of condition v

Re: pthread_lock

2013-03-05 Thread ishare
On Tue, Mar 05, 2013 at 01:39:54PM +0530, Mandeep Sandhu wrote: > On Tue, Mar 5, 2013 at 11:32 AM, wrote: > > On Tue, 05 Mar 2013 11:02:45 +0530, Mandeep Sandhu said: > > > >> next schedule. I think the waiting threads (processes) will moved from > >> the wait queue to the run queue from where th

Re: pthread_lock

2013-03-05 Thread Mandeep Sandhu
On Tue, Mar 5, 2013 at 11:32 AM, wrote: > On Tue, 05 Mar 2013 11:02:45 +0530, Mandeep Sandhu said: > >> next schedule. I think the waiting threads (processes) will moved from >> the wait queue to the run queue from where they will be scheduled to >> run. > > For bonus points, read source code and

Re: pthread_lock

2013-03-04 Thread Valdis . Kletnieks
On Tue, 05 Mar 2013 11:02:45 +0530, Mandeep Sandhu said: > next schedule. I think the waiting threads (processes) will moved from > the wait queue to the run queue from where they will be scheduled to > run. For bonus points, read source code and/or comments and figure out what Linux does to prev

Re: pthread_lock

2013-03-04 Thread Mandeep Sandhu
On Tue, Mar 5, 2013 at 10:14 AM, ishare wrote: > > > when pthread_unlock(mutex) is called , do other threads waiting for mutex be > waked up immediately? > or be waked up at the next schedule? next schedule. I think the waiting threads (processes) will moved from the wait queue to the run queu

pthread_lock

2013-03-04 Thread ishare
when pthread_unlock(mutex) is called , do other threads waiting for mutex be waked up immediately? or be waked up at the next schedule? ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinf