create account

Just a Simple Parallel Runner in C# by justyy

View this thread on: hive.blogpeakd.comecency.com
· @justyy · (edited)
$67.37
Just a Simple Parallel Runner in C#
I need a quick GNU Parallel substitute on Windows, and here is a simple parallel runner that is implemented in C# .NET 4.6.

Github Source: https://github.com/DoctorLai/SimpleRunner

# Features of `Simple Parallel Runner`
- Run multiple tasks at command line
- Tasks synchronization
- Timeout
- Jobs can be defined in a job list file.

# Examples
it is possible to specify alternative e.g. using `.js=wscript.exe` and/or `*.vbs=wscript.exe"`. For example,

> SimpleRunner job1.vbs job2.vbs job3.vbs job4.js
Process Starts: cscript.exe /Nologo job1.vbs
Process Starts: cscript.exe /Nologo job4.js
Process Starts: cscript.exe /Nologo job2.vbs
Process Starts: cscript.exe /Nologo job3.vbs
1
Process Stops: cscript.exe /Nologo job1.vbs
2
Process Stops: cscript.exe /Nologo job2.vbs
4
Process Stops: cscript.exe /Nologo job4.js
3
Process Stops: cscript.exe /Nologo job3.vbs


If you specify wscript.exe to run, then all the output will not be redirected to the console. Instead, message dialogs will be pop-up, if you use WScript.Echo.

> SimpleRunner job1.vbs job2.vbs job3.vbs job4.js .js=wscript.exe .vbs=wscript.exe
Process Starts: wscript.exe /Nologo job1.vbs
Process Starts: wscript.exe /Nologo job2.vbs
Process Starts: wscript.exe /Nologo job4.js
Process Starts: wscript.exe /Nologo job3.vbs
Process Stops: wscript.exe /Nologo job2.vbs
Process Stops: wscript.exe /Nologo job4.js
Process Stops: wscript.exe /Nologo job1.vbs
Process Stops: wscript.exe /Nologo job3.vbs


Please note that the 32-bit scripting engines aree located at e.g. `C:\Windows\SysWOW64` while the 64-bit variants are located at `C:\Windows\System32`.

## Specify the Runner Paths and Parameters
As you can see in the above example, the runners can be specified using the `.ext=path` format where ext is the job file extension. Also you can specify the parameters to pass for that [runner](https://helloacm.com/just-a-simple-parallel-runner-in-c/), for example:

> SimpleRunner .php=php.exe -php=/para1 -php=/para2 a.php b.php
In this case, two processes will be invoked in parallel.

> php.exe /para1 /para2 a.php
php.exe /para1 /para2 b.php


.vbs and .js are pre-configured with /Nologo parameter.

## Specify the timeout for processes

Each parallel process will run until it terminates, however, you could set a timeout limit for all processes.

> SimpleRunner job1.vbs job2.vbs job3.vbs job4.js timeout=1
Process Starts: cscript.exe /NoLogo job1.vbs
Process Starts: cscript.exe /NoLogo job4.js
Process Starts: cscript.exe /NoLogo job2.vbs
Process Starts: cscript.exe /NoLogo job3.vbs
Four independent processes are killed and terminated because the timeout is set to 1ms.

## Specify a job list

You could put each line a job task in a job list file, for example,

> SimpleRunner jobs=list1.txt jobs=list2.txt


where list1.txt and list2.txt are two plain text files that contain each line a job.

# Source Code
Github Source: https://github.com/DoctorLai/SimpleRunner

# Screenshot
![](https://helloacm.com/wp-content/uploads/2016/09/SimpleRunner-Examples.jpg)

# Proof of work
`doctorlai` is my github ID and you can view my profile https://github.com/DoctorLai which has my steemit URL page.


<br /><hr/><em>Posted on <a href="https://utopian.io/utopian-io/@justyy/just-a-simple-parallel-runner-in-c">Utopian.io -  Rewarding Open Source Contributors</a></em><hr/>
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
properties (23)
authorjustyy
permlinkjust-a-simple-parallel-runner-in-c
categoryutopian-io
json_metadata"{"community":"utopian","app":"steemit/0.1","format":"markdown","repository":{"id":69671043,"name":"SimpleRunner","full_name":"DoctorLai/SimpleRunner","owner":{"login":"DoctorLai","id":1764434,"avatar_url":"https://avatars3.githubusercontent.com/u/1764434?v=4","gravatar_id":"","url":"https://api.github.com/users/DoctorLai","html_url":"https://github.com/DoctorLai","followers_url":"https://api.github.com/users/DoctorLai/followers","following_url":"https://api.github.com/users/DoctorLai/following{/other_user}","gists_url":"https://api.github.com/users/DoctorLai/gists{/gist_id}","starred_url":"https://api.github.com/users/DoctorLai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DoctorLai/subscriptions","organizations_url":"https://api.github.com/users/DoctorLai/orgs","repos_url":"https://api.github.com/users/DoctorLai/repos","events_url":"https://api.github.com/users/DoctorLai/events{/privacy}","received_events_url":"https://api.github.com/users/DoctorLai/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/DoctorLai/SimpleRunner","description":"Just a Simple Parallel Runner","fork":false,"url":"https://api.github.com/repos/DoctorLai/SimpleRunner","forks_url":"https://api.github.com/repos/DoctorLai/SimpleRunner/forks","keys_url":"https://api.github.com/repos/DoctorLai/SimpleRunner/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DoctorLai/SimpleRunner/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DoctorLai/SimpleRunner/teams","hooks_url":"https://api.github.com/repos/DoctorLai/SimpleRunner/hooks","issue_events_url":"https://api.github.com/repos/DoctorLai/SimpleRunner/issues/events{/number}","events_url":"https://api.github.com/repos/DoctorLai/SimpleRunner/events","assignees_url":"https://api.github.com/repos/DoctorLai/SimpleRunner/assignees{/user}","branches_url":"https://api.github.com/repos/DoctorLai/SimpleRunner/branches{/branch}","tags_url":"https://api.github.com/repos/DoctorLai/SimpleRunner/tags","blobs_url":"https://api.github.com/repos/DoctorLai/SimpleRunner/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DoctorLai/SimpleRunner/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DoctorLai/SimpleRunner/git/refs{/sha}","trees_url":"https://api.github.com/repos/DoctorLai/SimpleRunner/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DoctorLai/SimpleRunner/statuses/{sha}","languages_url":"https://api.github.com/repos/DoctorLai/SimpleRunner/languages","stargazers_url":"https://api.github.com/repos/DoctorLai/SimpleRunner/stargazers","contributors_url":"https://api.github.com/repos/DoctorLai/SimpleRunner/contributors","subscribers_url":"https://api.github.com/repos/DoctorLai/SimpleRunner/subscribers","subscription_url":"https://api.github.com/repos/DoctorLai/SimpleRunner/subscription","commits_url":"https://api.github.com/repos/DoctorLai/SimpleRunner/commits{/sha}","git_commits_url":"https://api.github.com/repos/DoctorLai/SimpleRunner/git/commits{/sha}","comments_url":"https://api.github.com/repos/DoctorLai/SimpleRunner/comments{/number}","issue_comment_url":"https://api.github.com/repos/DoctorLai/SimpleRunner/issues/comments{/number}","contents_url":"https://api.github.com/repos/DoctorLai/SimpleRunner/contents/{+path}","compare_url":"https://api.github.com/repos/DoctorLai/SimpleRunner/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DoctorLai/SimpleRunner/merges","archive_url":"https://api.github.com/repos/DoctorLai/SimpleRunner/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DoctorLai/SimpleRunner/downloads","issues_url":"https://api.github.com/repos/DoctorLai/SimpleRunner/issues{/number}","pulls_url":"https://api.github.com/repos/DoctorLai/SimpleRunner/pulls{/number}","milestones_url":"https://api.github.com/repos/DoctorLai/SimpleRunner/milestones{/number}","notifications_url":"https://api.github.com/repos/DoctorLai/SimpleRunner/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DoctorLai/SimpleRunner/labels{/name}","releases_url":"https://api.github.com/repos/DoctorLai/SimpleRunner/releases{/id}","deployments_url":"https://api.github.com/repos/DoctorLai/SimpleRunner/deployments","created_at":"2016-09-30T13:53:05Z","updated_at":"2016-09-30T13:54:41Z","pushed_at":"2017-12-05T10:51:22Z","git_url":"git://github.com/DoctorLai/SimpleRunner.git","ssh_url":"git@github.com:DoctorLai/SimpleRunner.git","clone_url":"https://github.com/DoctorLai/SimpleRunner.git","svn_url":"https://github.com/DoctorLai/SimpleRunner","homepage":null,"size":8,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master","score":16.358963},"pullRequests":[],"platform":"github","type":"development","tags":["utopian-io","parallel","task-runner"],"links":["https://github.com/DoctorLai/SimpleRunner","https://helloacm.com/just-a-simple-parallel-runner-in-c/","https://github.com/DoctorLai","https://utopian.io/utopian-io/@justyy/just-a-simple-parallel-runner-in-c"],"image":["https://helloacm.com/wp-content/uploads/2016/09/SimpleRunner-Examples.jpg"]}"
created2017-12-05 11:04:54
last_update2017-12-05 11:07:15
depth0
children3
last_payout2017-12-12 11:04:54
cashout_time1969-12-31 23:59:59
total_payout_value50.406 HBD
curator_payout_value16.967 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length3,345
author_reputation280,616,224,641,976
root_title"Just a Simple Parallel Runner in C#"
beneficiaries
0.
accountarie.steem
weight48
1.
accountcnts
weight10
2.
accountfreedom
weight658
3.
accountknowledges
weight48
4.
accountnetuoso
weight6
5.
accounttransisto
weight70
6.
accountutopian-io
weight536
7.
accountxeldal
weight27
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id22,451,032
net_rshares20,593,069,472,814
author_curate_reward""
vote details (59)
@reggaemuffin ·
$0.36
Thank you for the contribution. It has been approved.

You can contact us on [Discord](https://discord.gg/UCvqCsx).
**[[utopian-moderator]](https://utopian.io/moderators)**
👍  , , , , , , , , , ,
properties (23)
authorreggaemuffin
permlinkre-justyy-just-a-simple-parallel-runner-in-c-20171205t123200929z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"community":"busy","app":"busy/1.0.0"}
created2017-12-05 12:32:00
last_update2017-12-05 12:32:00
depth1
children1
last_payout2017-12-12 12:32:00
cashout_time1969-12-31 23:59:59
total_payout_value0.358 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length172
author_reputation37,964,839,695,531
root_title"Just a Simple Parallel Runner in C#"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id22,457,270
net_rshares97,914,299,982
author_curate_reward""
vote details (11)
@justyy ·
Thank you! 谢谢
properties (22)
authorjustyy
permlinkre-reggaemuffin-re-justyy-just-a-simple-parallel-runner-in-c-20171205t135012636z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"app":"steemit/0.1"}
created2017-12-05 13:50:12
last_update2017-12-05 13:50:12
depth2
children0
last_payout2017-12-12 13:50:12
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length13
author_reputation280,616,224,641,976
root_title"Just a Simple Parallel Runner in C#"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id22,463,943
net_rshares0
@utopian-io ·
### Hey @justyy I am @utopian-io. I have just upvoted you!
#### Achievements
- Seems like you contribute quite often. AMAZING!
#### Community-Driven Witness!
I am the first and only Steem Community-Driven Witness. <a href="https://discord.gg/zTrEMqB">Participate on Discord</a>. Lets GROW TOGETHER!
- <a href="https://v2.steemconnect.com/sign/account-witness-vote?witness=utopian-io&approve=1">Vote for my Witness With SteemConnect</a>
- <a href="https://v2.steemconnect.com/sign/account-witness-proxy?proxy=utopian-io&approve=1">Proxy vote to Utopian Witness with SteemConnect</a>
- Or vote/proxy on <a href="https://steemit.com/~witnesses">Steemit Witnesses</a>

[![mooncryption-utopian-witness-gif](https://steemitimages.com/DQmYPUuQRptAqNBCQRwQjKWAqWU3zJkL3RXVUtEKVury8up/mooncryption-s-utopian-io-witness-gif.gif)](https://steemit.com/~witnesses)

**Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x**
properties (22)
authorutopian-io
permlinkre-justyy-just-a-simple-parallel-runner-in-c-20171206t215406169z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"community":"utopian","app":"utopian/1.0.0"}
created2017-12-06 21:54:06
last_update2017-12-06 21:54:06
depth1
children0
last_payout2017-12-13 21:54:06
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,004
author_reputation152,955,367,999,756
root_title"Just a Simple Parallel Runner in C#"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id22,604,761
net_rshares0