Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

c - pthread condition loop -


the typical pattern i've seen using pthread_cond_wait is:

pthread_mutex_lock(&lock);   while (!test)     pthread_cond_wait(&condition, &lock); pthread_mutex_unlock(&lock); 

why can't if statement used instead of while loop.

pthread_mutex_lock(&lock);   if (!test)     pthread_cond_wait(&condition, &lock); pthread_mutex_unlock(&lock); 

http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_cond_timedwait.html

when using condition variables there boolean predicate involving shared variables associated each condition wait true if thread should proceed. spurious wakeups pthread_cond_timedwait() or pthread_cond_wait() functions may occur. since return pthread_cond_timedwait() or pthread_cond_wait() not imply value of predicate, predicate should re-evaluated upon such return.

the while loop standard way of re-evaluating predicate, required posix.


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -