我需要编写一个监视/监视程序来检查一系列应用程序
监测计划应该能够
VB.NET中的哪种API可以帮助我实现这一目标?
任何代码示例都会非常有用
我在Windows中运行调用可执行文件的Perl脚本:
$command = "$path_to_exe -i $dir -o $results";
my $pid = fork();
if ( !$pid ) {
system($command);
#do stuff
} else {
#do stuff
}
print "Exiting..."
exit;
Run Code Online (Sandbox Code Playgroud)
而不是退出之后,perl.exe只是空闲.然后弹出窗口告诉我"Perl命令行解释器已停止工作".
我不知道很多有关Windows进程管理,我已经在这个论坛之前读取它的使用不是好的做法fork()
和exec()
,但代码工作得很好,除了解释不打烊的一部分.我已经尝试了从尝试在Unix中实现程序(它提供相同的错误)到使用Win32::Process
命令的一切 - 但没有任何作用.我希望可能有一个更简单的解决方案,可以让我保留我已经写过的内容.
如果有人能够在运行此代码时解释Windows中究竟发生了什么,那也将是一个帮助!
Eclipse(Luna)IDE遇到问题,在运行程序时我遇到了一个永无止境的循环,所以不得不终止程序.之后每次我尝试重新运行程序时它都会在加载调试配置时挂起.
我正在尝试创建一个Eclipse插件来检索文件名并为其添加注释.我不相信程序有错误,因为之前工作正常.我在另一个工作区中测试了一个简单的helloWorld程序,看看是否有任何问题,但程序运行正常.根据我的阅读,它可能与元数据文件有关,但我不知道如何纠正它.
问题
当试图加载Eclipse Luna框时,弹出框(这是正常的)在框的右下角,它会显示它正在加载的内容.当它试图加载org.eclipse.web.core时似乎挂起了.
该程序在循环发生之前工作正常,我可以毫无问题地运行它.
当Eclipse停止响应时,它询问"如果你想关闭程序"及其下面的内容,它会为您提供下面列出的一些问题详细信息.
问题细节
问题签名:
试过
清理和重建所有项目,禁用防火墙和防病毒软件,创建另一个基本程序,重新安装Eclipse和Java.
我在Play中运行一个应用程序activator run
,也许是5次中的3次,它会挂起,当我去的时候http://localhost:9000/
,它只是坐在那里永远旋转.
我也看到了很多promise timed out
错误.
我应该在哪里寻找这个问题?
我开始记录logLevel := Level.Debug
,但我没有看到任何错误.当应用程序正在旋转时,我看不到任何日志记录.
如果我让它坐下并旋转很长时间(约5分钟),它最终会出现这个错误:
[info] play.api.http.HttpErrorHandlerExceptions$$anon$1: Execution exception[[PrivilegedActionException: null]]
[info] at play.api.http.HttpErrorHandlerExceptions$.throwableToUsefulException(HttpErrorHandler.scala:265) ~[play_2.11-2.4.3.jar:2.4.3]
[info] at play.api.http.DefaultHttpErrorHandler.onServerError(HttpErrorHandler.scala:191) ~[play_2.11-2.4.3.jar:2.4.3]
[info] at play.core.server.Server$class.logExceptionAndGetResult$1(Server.scala:50) [play-server_2.11-2.4.3.jar:2.4.3]
[info] at play.core.server.Server$$anonfun$getHandlerFor$4.apply(Server.scala:59) [play-server_2.11-2.4.3.jar:2.4.3]
[info] at play.core.server.Server$$anonfun$getHandlerFor$4.apply(Server.scala:57) [play-server_2.11-2.4.3.jar:2.4.3]
[info] at scala.util.Either$RightProjection.flatMap(Either.scala:522) [scala-library.jar:na]
[info] at play.core.server.Server$class.getHandlerFor(Server.scala:57) [play-server_2.11-2.4.3.jar:2.4.3]
[info] at play.core.server.NettyServer.getHandlerFor(NettyServer.scala:33) [play-netty-server_2.11-2.4.3.jar:2.4.3]
[info] at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$8.apply(PlayDefaultUpstreamHandler.scala:139) [play-netty-server_2.11-2.4.3.jar:2.4.3]
[info] at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$8.apply(PlayDefaultUpstreamHandler.scala:139) [play-netty-server_2.11-2.4.3.jar:2.4.3]
[info] Caused by: java.security.PrivilegedActionException: null
[info] at java.security.AccessController.doPrivileged(Native Method) ~[na:1.8.0_20]
[info] at play.runsupport.Reloader$.play$runsupport$Reloader$$withReloaderContextClassLoader(Reloader.scala:39) ~[na:na]
[info] at play.runsupport.Reloader.reload(Reloader.scala:321) …
Run Code Online (Sandbox Code Playgroud) 我们知道在计算机上运行的所有内容都是由许多人合作的庞大程序.
因此,当计算机挂起而我们无法做任何事情时,会发生什么呢?此外,这个场景中的所有内容都冻结了程序中实现的内容吗?或者它是否像程序计数器卡住并且不能增加,因此处理器中存在一些问题?
当我使用mpeg4或h264编码器时,我能够使用ffmpeg 3.1.0的API成功编码图像以生成有效的AVI文件.但是,当我使用快速同步编码器(h264_qsv)时,avcodec_encode_video2会在某些时候挂起.我发现当使用1920x1080的图像时,avcodec_encode_video2很少会挂起.使用256x256图像时,该功能很可能会挂起.
我在下面创建了测试代码,演示了avcodec_encode_video2的挂起.代码将创建一个1000帧,256x256 AVI,比特率为400000.帧被简单分配,因此输出视频应该只是绿色帧.
使用Windows 7和Windows 10,使用32位或64位测试应用程序观察到该问题.
如果有人知道如何避免avcodec_encode_video2挂起,我将非常感激!在此先感谢您的任何帮助.
extern "C"
{
#ifndef __STDC_CONSTANT_MACROS
#define __STDC_CONSTANT_MACROS
#endif
#include "avcodec.h"
#include "avformat.h"
#include "swscale.h"
#include "avutil.h"
#include "imgutils.h"
#include "opt.h"
#include <rational.h>
}
#include <iostream>
// Globals
AVCodec* m_pCodec = NULL;
AVStream *m_pStream = NULL;
AVOutputFormat* m_pFormat = NULL;
AVFormatContext* m_pFormatContext = NULL;
AVCodecContext* m_pCodecContext = NULL;
AVFrame* m_pFrame = NULL;
int m_frameIndex;
// Output format
AVPixelFormat m_pixType = AV_PIX_FMT_NV12;
// Use for mpeg4
//AVPixelFormat m_pixType = AV_PIX_FMT_YUV420P;
// Output frame rate …
Run Code Online (Sandbox Code Playgroud) 在将Jenkins更新到2.156版(从1.6版开始)之后,我们的一些构建作业在完成后以及移至构建后动作之前会卡住。作业本身在5分钟内完成(与之前相同),然后挂起5-10分钟,然后继续前进。
我设法将其缩小为:
"Executor #10 for master : executing 03_masa #4390" Id=34464 Group=main TIMED_WAITING
at java.lang.Thread.sleep(Native Method)
at hudson.util.ProcessTree$WindowsOSProcess.killSoftly(ProcessTree.java:560)
at hudson.util.ProcessTree$WindowsOSProcess.killRecursively(ProcessTree.java:520)
at hudson.util.ProcessTree$Windows.killAll(ProcessTree.java:666)
at hudson.Launcher$LocalLauncher.kill(Launcher.java:955)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:510)
at hudson.model.Run.execute(Run.java:1810)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)
Run Code Online (Sandbox Code Playgroud)
可以在此处找到引用的代码(自2.141版本开始提供)。
我们可以做些什么吗?
我的电脑挂起,当我send key
在Form_Shown()
和放置Breakpoint
在Form_KeyDown()
private void Form1_KeyDown(object sender, KeyEventArgs e)
{ //breakpoint here
if (e.KeyCode == Keys.A)
{
MessageBox.Show("caught");
}
}
private void Form1_Shown(object sender, EventArgs e)
{
SendKeys.Send("A");
}
Run Code Online (Sandbox Code Playgroud) 我正在使用Spymemcached访问服务器上的Memcached.我使用以下命令启动了memcached
memcached -m 4096 -p 11211 -u memcache -l 127.0.0.1 -d -vvv
Run Code Online (Sandbox Code Playgroud)
我正在使用以下驱动程序将一些键/值对放入Memcache.出于某种原因,在最后一次get
操作之后,该main
功能才会挂起; 它永远不会终止.
import java.net.InetSocketAddress;
import net.spy.memcached.MemcachedClient;
public class memcache {
public static void main(String args[]) {
//Connect to Memcache.
MemcachedClient c=null;
try{
c = new MemcachedClient(
new InetSocketAddress("127.0.0.1", 11211));
} catch (Exception e) {
System.err.println("Could not connect to Memcached.");
System.exit(-1);
}
System.out.println("Connected to Memcached.");
Object myObject = null;
for (int i = 0; i < 10; i++)
{
c.set(new String("HELLO"), 3600, i+1);
myObject=c.get("HELLO");
String …
Run Code Online (Sandbox Code Playgroud) 我有一系列长期运行的功能.我想将它们包装在一起,Task
以便我可以同时运行所有这些,而不是等待每个顺序完成.
方法调用,并且所有相关的字段值,方法和属性都存在于静态类中.
我遇到一个问题,其中静态类构造函数无法完成,因为当我在其中包装方法时它挂起Task.Run
.
符合必要的Mininmal,Complete和Verifiable示例要求......
using System;
using System.Linq;
using System.Threading.Tasks;
namespace MCVEAsyncHang
{
class Program
{
private static readonly string[] _foo;
static Program()
{
_foo = Task.WhenAll(Task.Run(new Func<string>(One))).Result;
}
private static string One()
{
return "Foo";
}
private static void Print()
{
Console.WriteLine(
_foo.Aggregate((total, current) =>
total + string.Format("{0}{1}", Environment.NewLine, current)));
}
static void Main(string[] args)
{
Print();
Console.WriteLine("Done");
Console.ReadLine();
}
}
}
Run Code Online (Sandbox Code Playgroud)
我知道我可以创建一些其他方法并调用它(如果必须的话,我会这样做),但如果可能的话,我宁愿将它保留在静态类构造函数中.