Find Jobs
Hire Freelancers

Basic thread polling code in C#

$30-50 USD

In Progress
Posted almost 12 years ago

$30-50 USD

Paid on delivery
I need someone familiar with threads and thread polling in C# to write some pretty basic piece of code for me. There's a Form with a multiline TextBox, a Button and a StatusBar. User enters a few lines of text in the TextBox and clicks the Button. For each line in the TextBox I need a foo(line) method to be called BUT I want this to be done in multiple threads (max number of threads running at once should be hard-coded). Each thread should also increment a global counter variable / property of Form1 class (you need to be familiar with data monitoring/locking so that the value doesn't get wrong) and update the statusbar text with its value when it's finished. Basically, I need the following pseudocode translated into working C#: foreach(line in textbox) { if(number_of_running_threads == max_number_of_threads) { wait_until_there_is_a_free_thread(); } run_in_thread( foo(line) ); } You can leave the foo() body empty or put some random sleep() there or whatever. For an experienced C# dev this shouldn't take longer than an hour.
Project ID: 1692317

About the project

1 proposal
Remote project
Active 12 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
will be done in 1 hour
$30 USD in 0 day
5.0 (72 reviews)
6.3
6.3

About the client

Flag of POLAND
Katowice, Poland
5.0
2
Member since Jul 9, 2010

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.