<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Process-Control on tenfy's blog</title><link>https://tenfy.cn/tags/process-control/</link><description>Recent content in Process-Control on tenfy's blog</description><generator>Hugo</generator><language>zh-CN</language><lastBuildDate>Sat, 16 Sep 2017 16:06:16 +0000</lastBuildDate><atom:link href="https://tenfy.cn/tags/process-control/index.xml" rel="self" type="application/rss+xml"/><item><title>linux只允许程序的一个进程实例运行</title><link>https://tenfy.cn/posts/only-one-instance/</link><pubDate>Sat, 16 Sep 2017 16:06:16 +0000</pubDate><guid>https://tenfy.cn/posts/only-one-instance/</guid><description>&lt;p>有的时候，我们需要确保当前只有一个进程实例在运行。特别是定时跑定时任务的时候。&lt;/p>
&lt;p>unix/linux的cron可以配置定时任务，让它在指定的时间运行。但是，只要到任务指定的时
间，cron就会fork一个新的进程来执行任务，它不会保证前一个任务运行完成了，下一个任
务才开始。而有时我们却需要只能有一个实例运行。&lt;/p></description></item></channel></rss>