On 04/02/2012 04:03 AM, skr...@hushmail.com wrote:
> ok, I need a to create a thread that will runs along side or inside the
> daemon thread that does nothing but check 3 buffers, then have a global
> lock, so the functions know when to return the values or when to wait
> for the memcache thread to finish processing.
> 
> So I would need to create a struct that would hold all the elements that
> would make a queue. type of request(get, or set), keynames, keydata(if
> set request), and also number of elements ie keys.
> 
> Also have a global lock, so the requesting functions will run in order
> with the queue processing and won't run ahead of each other. Wow.

If you process jobs coming from the queue in a single thread, you
probably don't need a lock. Locks are only needed when accessing memory
that is also used by other threads. If there are no other threads
accessing the same memory locations, you don't need locks.



-- 
________________________________________________________________
Paul J Stevens        pjstevns @ gmail, twitter, skype, linkedin

  * Premium Hosting Services and Web Application Consultancy *

           www.nfg.nl/i...@nfg.nl/+31.85.877.99.97
________________________________________________________________
_______________________________________________
Dbmail-dev mailing list
Dbmail-dev@dbmail.org
http://mailman.fastxs.nl/cgi-bin/mailman/listinfo/dbmail-dev

Reply via email to