Linux环形buff模拟多线程信号量操作
互斥锁mutex变量的值非0即1,只能用来表示两种状态下的临界资源。而信号量是与之类似的,用来表示可用资源的,区别在于,信号量可以表示多个可用资源的。--值为2的信号量也就是特殊的互斥锁了。那么下边就简单实现信号量表示多个资源访问的生产者消费者问题了。#include <stdio.h>#include <stdlib.h>#include...
View Article栈帧的不安全程序示例
栈帧简述堆栈(stack):c语言程序运行时必须有的记录调用记录和参数的空间。保存项: 函数调哟能框架 参数传递 返回值保存 提供局部变量一个老司机通过改变栈帧进行开车的故事#include <stdio.h>#include <stdlib.h>#include <string.h>#include <errno.h>void...
View ArticleLinux多线程-互斥&条件变量与同步
多线程代码问题描述我们都知道,进程是操作系统对运行程序资源分配的基本单位,而线程是程序逻辑,调用的基本单位。在多线程的程序中,多个线程共享临界区资源,那么就会有问题:比如#include <pthread.h>#include <unistd.h>#include <stdio.h>#include <stdlib.h>int g_val =...
View ArticleEncrypting an external drive using LUKS
I recently had a friend who lost an external hard drive where she stored private information. This hard drive can now be read by anyone who finds it because there was no protection on it. To prevent...
View ArticleUbuntu 16.04下为Android编译OpenCV 3.1.0 Manager
最近想在Android上尝试一下SIFT和SURF匹配算法,但考虑到这些算法都是专利保护的,并没有被包含在预编译库中,所以还需要自己来动手编译OpenCV Android SDK。在OpenCV...
View Article进程间通信方式总结
linux下的进程通信手段基本上是从Unix平台上的进程通信手段继承而来的。 而对Unix发展做出重大贡献的两大主力AT&T的贝尔实验室及BSD(加州大学伯克利分校的伯克利软件发布中心)在进程间通信方面的侧重点有所不同。前者对Unix早期的进程间通信手段进行了系统的改进和扩充,形成了“system V...
View ArticleBFQ Still Trying To Replace The CFQ I/O Scheduler In Linux
BFQ Still Trying To Replace The CFQ I/O Scheduler In linux Written by Michael Larabel inLinux Kernel on 27 July 2016 at 01:44 PM EDT.Add A Comment For a number of months there's been an effort to...
View ArticleCoreOS发起的友好兼容Kubernetes的存储系统:Torus
【编者的话】容器和微服务管理一直有一个最棘手的问题就是持久化存储,CoreOS最近发起了一个项目Torus,给Kubernetes用户提供了一个友好兼容的分布式存储集群,也欢迎大家积极参与这个开源项目。 为了在容器编排领域内继续快速创新, CoreOS 发起了一个开源项目,旨在给Kubernetes用户提供一个合适的存储系统来配合Pods工作。 Torus...
View ArticleMicrosoft pushes for cross-platform applications with ChakraCore for Linux...
Earlier this year, Microsoft open-sourced key components of ChakraCore . Now, the company is pushing for cross-platform applications by bringing ChakraCore to linux and OS X. For those unaware,...
View ArticleHeadlander, the new game from Double Fine Productions will not come to Linux
This is very sad to see from a previously very linux friendly developer. Headlander from Double Fine Productions will not come to Linux due to their choice of graphics API. The developer posted this on...
View ArticleUsing Emacs - 12 - Flycheck, Jedi, Python
This week, we're going to look at my setup for python programming. I'm an educator, not a professional developer so I'm not working in huge code bases with dozens or more files at a time. I do...
View ArticleLinux Kernel 4.6.5 Has Numerous Nouveau Improvements, ARM and ARM64 Fixes
Today, July 27, 2016, Greg Kroah-Hartman announced the availability of the fifth maintenance update for the linux 4.6 kernel series, urging all users to update as soon as possible. The Linux 4.6...
View ArticleProtecting Android with more Linux kernel defenses
Posted by Jeff Vander Stoep, Android Security team Android relies heavily on the linux kernel for enforcement of its security model. To better protect the kernel, we’ve enabled a number of mechanisms...
View ArticleWine 1.9.15 Has Patches for Alone in the Dark, Bloodrayne and Kings Quest 8
Wine 1.9.15 has been made available for download for GNU/linux users who want to run various windows games and applications on their favorite distributions, along with Wine-Staging 1.9.15. With 22...
View ArticleLinux Kernel 4.4.16 LTS Released with Over 150 Changes, It's Already in Solus
Immediately after announcing the release of linux kernel 4.6.5 , renowned kernel developer Greg Kroah-Hartman published details about the sixteenth maintenance update for the long-term supported Linux...
View ArticleMicrosoft Surface 3 Touchscreen & Other Input Improvements For Linux 4.8
Microsoft Surface 3 Touchscreen & Other Input Improvements For linux 4.8 Written by Michael Larabel inHardware on 27 July 2016 at 07:39 PM EDT.Add A Comment The input updates for Linux 4.8 bring...
View ArticleA Guide To Customising Linux Mint Cinnamon Keyboard Shortcuts
Updated July 20, 2016 . Introduction I previously release an article called " The Complete List Of linux Mint 18 Keyboard Shortcuts For Cinnamon ". This guide will show you how to adjust the keyboard...
View ArticleAnd That’s How I Ended up Developing with a Chromebook
In my previous post on laptops for developers , I shortlisted a few options.In this one, I share the story of how I will end up developing with a Chromebook. I almost bought a Lenovo After mulling it...
View Article