Posts

Showing posts from December 16, 2018

Does Task.Run guarantee each method will be run to completion

Image
up vote 0 down vote favorite There are two methods that together must be run in parallel, this is due to a time constraint. The next piece of data to work on is coming every 100ms for example. List<Widget> widgetList = new List<Widget>() { file list with 100 widget objects } List<Task> tasks = new List<Task>(); foreach (Widget widget in widgetList) { Task t = Task.Run(async () => { var result = await widget.Analyze(newData); ReportResults(result); }); tasks.Add(t); } Task.WaitAll(tasks.ToArray()); No it is not a complete code example but should be enough for the question which is as follows: Can I be sure that ReportResults(result) will run to completion per Task or is it possible that if a Task finishes and calls ReportResults(result) and

Ubuntu 18.04 in VM: Desktop does not restore window size

Image
up vote 2 down vote favorite I run Ubuntu as Guest OS in a Windows VirtualBox VM Host. In the existing, up-to-date VB, I have just moved from 17.04 to 18.04 by creating a new VM/ .vdi from scratch (including Guest Additions). Previously, whatever I resized the whole VM/desktop window to was remembered across reboots, which is obviously desirable. Under 18.04 (which, remember is now using GNOME instead of Unity, if that is relevant) this does not happen. The resizing is fine, but when I reboot it reverts to some small-ish size. I imagine this is a Guest Ubuntu issue, not a Host VirtualBox one, so I don't think trying to ask the VB people will help any. Obviously I have installed Guest Additions, and do have View > Auto-resize Guest Display enabled. Is this happening to other VirtualBox+18.04 users? Am I missing s