task

Scheduling multiple .net core console apps

ε祈祈猫儿з 提交于 2019-12-10 23:31:51
问题 I'm a newbie to .net core and have a question about how to schedule multiple .net core console apps in the Windows task scheduler. How I was able to schedule a test console app was to set the program/script to "dotnet", the args to "mytestnetcoreconsoleapp.dll", and the startup directory to that which contained the dll. Would this be correct to do for multiple console apps though? From what I understand about the task scheduler, having multiple tasks with the same program name is a no no. I

Task Limit for Async Calls?

社会主义新天地 提交于 2019-12-10 22:06:42
问题 I have a .NET 4.5 WCF client that works synchronously. I am updating it to use the new async/await functionality to make multiple simultaneous server calls to get chunks of data concurrently. Before i finish, I have a concern that all of the threads running at the same time will saturate the server (not to mention kill my Azure worker role when I upgrade to that next year). Is there a way to centrally govern the total amount of Task threads I use at the class level? The code shares an

OpenMP Task Scheduling Policies

一曲冷凌霜 提交于 2019-12-10 21:59:56
问题 I would like to know how the task scheduling of the OpenMP task queue is performed. Here I read that, by default, OpenMP imposes a breadth-first scheduler and that they did some tests FIFO vs. LIFO, but they don't say anything about the default. Since I only have a single thread (I use the single directive) creating multiple tasks, I don't think it makes any sense comparing their breadth-first vs work-first scheduling. So, is the default FIFO or LIFO? And is it possible to change it? Thanks

How to execute task for a specific period in Java.?

我怕爱的太早我们不能终老 提交于 2019-12-10 21:48:59
问题 In fact I would execute a specific task( a set of instructions) for a determined period. For example : I want my program to execute the task for 5 minutes, if it gets the right result it stops , else it will continue executing normal task for the 5 minutes and in the end it tells me. How can I implement this in Java. 回答1: You could something like the following: import java.util.concurrent.* ; ExecutorService svc = Executors.newFixedThreadPool( 1 ) ; svc.submit( new Runnable() { public void

Task status :Waiting for activation -DownloadStringTaskAsync -WP8

不问归期 提交于 2019-12-10 21:37:09
问题 The status of task is always "Waiting for activation".The Result of the task ="". i dont understand why...Thanks for your help The UI calls the GetDocLibs method. public class ServerFunctions { public static List<BdeskDocLib> GetDocLibs(bool onlyDocLibPerso) { string xmlContent = GetXml(); List<BdeskDocLib> result = BdeskDocLib.GetListFromXml(xmlContent, onlyDocLibPerso); return result; } private static String GetXml() { Task<String>task=requesteur.Query(dataRequestParam); task.Wait();

Is this a proper way of calling synchronous methods asynchronously?

微笑、不失礼 提交于 2019-12-10 21:15:47
问题 I was using code like this: handler.Invoke(sender, e); But the problem with that code is that it is synchronous and all it really does is update the GUI. It is not necessary for the server to wait for it to complete so it should be made asynchronous. I don't really want to use BeginInvoke and EndInvoke because a callback method is not necessary in this case. Is this a suitable alternative? Task.Factory.StartNew(() => handler.Invoke(sender, e)); 回答1: The way you did it is fine, another way to

Ant can't find a executable in the Windows path

大兔子大兔子 提交于 2019-12-10 21:13:54
问题 I got a simple ant target : <target name="doxygen"> <exec executable="doxygen" dir="${basedir}/doxygen"> <arg value="Doxyfile" /> </exec> </target> I'm on Windows Seven. When i try the same command line ( doxygen Doxyfile ) in the Windows console, it works perfectly. The doxygen executable can by found because i added the good path in my PATH environment variable. But ANT juste can't find the doxygen executable and i get the following error : build.xml:83: Execute failed: java.io.IOException:

Using .NET 4.0 Task in ASP.NET

元气小坏坏 提交于 2019-12-10 21:04:45
问题 Are there any caveats or short comings to using the new Task API in System.Threading.Task in ASP.NET hosted under IIS? I know prior to .NET 4.0 working with any of the ThreadPool actions inside of IIS was always recommended to be avoided. 回答1: Any caveats to using ThreadPool with IIS would still be valid using System.Threading.Task , as the Task API is just an additional layer of abstraction over System.Threading . For long-running tasks in the background, I use a ThreadPool inside a Windows

How to - Multiple Async tasks with timeout and cancellation

老子叫甜甜 提交于 2019-12-10 20:14:53
问题 I would like to fire several tasks while setting a timeout on them. The idea is to gather the results from the tasks that beat the clock, and cancel (or even just ignore) the other tasks. I tried using extension methods WithCancellation as explained here, however throwing an exception caused WhenAll to return and supply no results. Here's what I tried, but I'm opened to other directions as well (note however that I need to use await rather than Task.Run since I need the httpContext in the

Sending email using Gradle

徘徊边缘 提交于 2019-12-10 20:05:37
问题 I have written a task (actually copied from Internet), it sends email to given email. But when I run it, I get java.lang.ClassNotFoundException: javax.mail.internet.MimeMessage exception. I have included compile group: 'javax.mail', name: 'javax.mail-api', version: '1.5.1' in dependencies but still getting this. Here is the task apply plugin: 'com.android.application' class MailSender extends DefaultTask { @TaskAction def sendMail(){ def mailParams = [ mailhost: "smtp.gmail.com", mailport: