Asynchronous and remote execution with powershell 2 ctp3 - An interesting feature released with the PowerShell 2 CTP3 is the ability to run background jobs consisting of arbitrary PowerShell code. In order to use this functionality you must download and install the PowerShell 2 CTP3 and the WinRM (Windows Remote Management) 2.0 CTP. Keep in mind that installing the CTP requires uninstalling previous versions of PowerShell. Depending on the PowerShell and operating system versions involved the procedure can vary. Google/Bing is your friend. Once bringing up PowerShell you have to enable remoting by invoking the aptly named Enable-PSRemoting cmdlet Enable-PSRemoting -force Now the meat. Consider the following code: # copy bigfile.txt on a background thread $job = start-job -scriptBlock { cp bigfile.txt bigfilecopy.txt } # here's where we'd perform some other logic while our file copies # wait for job...
Easy Concurrency with Stackless Python - Since messing around with Erlang over the last couple months I've been very impressed with it's simplicity in managing concurrency. Erlang's message passing infrastructure really allows developers to have the locking just work without doing anything unnatural in code for synchronization. You almost let the problems define the locking behavior for you. Such elegance isn't limited Erlang, oh no. Python's also been shown some concurrency-love by way of a specialized implementation called Stackless Python. Stackless Python avoids using C's call stack and relies on lightweight microthreads rather than operating system threads or processes for concurrency. Channels (similar to Erlang's message passing) are used for synchronization and communication between tasklets (the implementation of microthreads). Note that stackless python is a cooperative multitasking framework so you do have the responsibility of explicitly relinquishing...
Parallel Programming with the Task Parallel Library and PLINQ in .Net 4.0 - It's no secret that parallel computing is becoming more important. As clock speeds have stagnated and the number of cores per die have increased one thing has become clear. Software developers have to adapt to the current state of processors by writing code that's more parallelizable. In the past many programmers have avoided parallel processing when possible mainly due to its complexity even in the face of an obvious increase in throughput. Those that have parallelized have often done it poorly and suffered through some serious misery as a result. We're running out of options, though. In order to get more done faster we have to do more at once. Development platform providers have been scrambling lately to try to simplify parallel development and minimize the amount of work we'll have...
Asynchronous Programming in Cocoa Touch - It's unavoidable. Pretty much anywhere you go as a programmer these days concurrency is important. It's no less important on mobile platforms like the iPhone. In this post I intend to outline the fundamental techniques necessary for asynchronous programming on the iPhone. While these techniques could very well apply to standard, desktop Cocoa I'll focus on Cocoa touch. I'll cover three basic approaches: NSObject's performSelectorInBackground message, NSThread and NSTimer. NSObject's performSelectorInBackground message NSObject's performSelectorInBackground message can be used to easily farm off tasks that run asynchronously. Here's an example that could be placed in a view controller. -(void) workerThread { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; NSString *str = [NSString stringWithContentsOfURL:[NSURL URLWithString:@"http://www.chrisumbel.com"]]; [pool release]; } - (void)viewDidLoad { [super viewDidLoad]; [self performSelectorInBackground:@selector(workerThread) withObject:nil]; } performSelectorInBackground simply executed workerThread asynchronously. Not much...
Tags:
.Net .net framework 4.0 ADO.NET Android AppleScript Astoria BI BeOS C C++ Data Services EF GNOME GObject Groovy HTML Haiku JVM Java Mac MongoDB ORM Objective-C Operating Systems Oracle SSRS Solr VS 2010 Vala Web Services appengine c# clojure cloud clr cocoa touch concurrency couchdb cql curl database django dlr dynamic entity framework erlang exchange server filestream full-text functional go iPhone indexes ironpython ironruby jQuery linq lisp lucene mongodb monitoring natural language object oriented parallel performance podcasts powershell python rails refactoring remoting reporting services rs ruby scripting security setpolicies simpledb sql 2008 sql server systems programming testing tools vb virtualization wave webdav windows xml