LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Blogs
User Name
Password

Notices

Old

Why and how to use condition variables? - Pthreads

Posted 02-06-2013 at 01:40 AM by TheIndependentAquarius
Updated 02-06-2013 at 05:55 AM by TheIndependentAquarius

  • Q: What is a condition variable?
    A: A condition variable is a variable of type `pthread_cond_t`. It is
    used to suspend the thread execution until some condition is true.

  • Q: Is a condition variable dependent on a mutex lock to work properly? Why?
    A: Explaining with an example:

    Assumptions:
    1. There is a variable `x` whose current value is 0.
    2. There is a thread `threadA` whose task is to start some job once the
      variable `x` reaches the value 1000.
    3. There
...
Senior Member
Posted in PThreads
Views 777 Comments 0 TheIndependentAquarius is offline
Old

#! toddler just like me (:

Posted 01-31-2013 at 08:26 AM by jamison20000e
Updated 06-03-2014 at 10:38 AM by jamison20000e

My nephew JJ is almost two: so of course I'm setting him up a (literally this (now on Xfce; LibreOffice Writer; Iceweasel; Google Drive) computer (vaio-pcv-r556ds | Linux-Debain-Crunchbangcrun\#!-Openbox\*). For the first year I will lock it down with baby-friendly programs mostly only icons and widgets (e.g: solar system, bouncing ball, sliding block puzzle, moon and stuff) so no taskbar on WMs like: Educational Desktops(most *nix flavors offer free Edu-D-tops i.g. Sugar or educational-desktop-lxde...
Senior Member
Posted in Newbie++
Views 3216 Comments 2 jamison20000e is offline
Old

C++ had lambda functions!

Posted 01-31-2013 at 01:21 AM by hydraMax (Bits and Pixels)

I'm doing a CS class which forces me to use C++. I was not very excited about this. However, I have recently be greatly encouraged by the discovery that C++ does, in fact, have lambda functions (or, more properly, anonymous functions) at least in the C++11 standard:

https://en.wikipedia.org/wiki/Anonym...ctions#C.2B.2B

Basically, the big deal here is that I can construct new functions /inside/ of other functions, and even capture variables from the context. This,...
Member
Posted in Uncategorized
Views 420 Comments 0 hydraMax is offline
Old

Controlling VLC via openbox key bindings... and wget(!)

Posted 01-28-2013 at 10:21 AM by the dsc (linux-related notes)
Updated 01-28-2013 at 06:10 PM by the dsc (fixing some stuff, redirection didn't work that way)

On openbox' rc.xml, in the corresponding section:

Code:
    <keybind key="W-z">
      <action name="Execute">
<execute>wget http://127.0.0.1:8080/requests/status.xml?command=pl_previous -O /dev/null</execute> 
      </action>
    </keybind>
    <keybind key="W-x">
      <action name="Execute">
	<execute>wget http://127.0.0.1:8080/requests/status.xml?command=pl_next
...
Member
Posted in Uncategorized
Views 623 Comments 0 the dsc is offline
Old

Aye, aye, My Pi!

Posted 01-28-2013 at 08:45 AM by brianL

Been having tons of fun with my recently acquired Raspberry Pi, and a few ounces of frustration. So far I've got three distros to play with: Raspbian (based on Debian "Wheezy"), that came ready installed on an SD card; Arch Linux Arm, and SlackwareArm, which I've installed on SD myself. It's a bit particular about SD cards, the Pi. Some work, some don't. That was a source of some of the frustration. Another was because Arch has changed to systemd, which made some online info obsolete....
LQ 5k Club
Posted in Uncategorized
Views 12192 Comments 9 brianL is offline

  



All times are GMT -5. The time now is 11:59 AM.

Main Menu
Advertisement

My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration