1

Recently I have been thinking combining C# applications with a website, so that we can run multiple threads in C# and complete more tasks in the time it would take PHP would to do 1.

Most of us know that PHP Runs on a single thread and therefor we cant do multiple actions at the same time

But it would be nice if we can do something like:

$SharpEntity = new CSharpExecute();

$SharpEntity->add("downloader.class http://server.com/file.ext");
$SharpEntity->add("downloader.class http://server.com/file2.ext");
$SharpEntity->add("downloader.class http://server.com/file3.ext");

$SharpEntity->initialize();

while($SharpEntity->completed === false)
{
   $SharpEntity->Update();
}

echo 'Files Grabbed';

This is just a basic example but would it actually be possible to do such a thing and if so, how can you do this?

I know that Facebook and other large systems do something like this but with C++, what you guys think?

RobertPitt
  • 56,863
  • 21
  • 114
  • 161
  • If you want to run C# in a website why not just use asp.net - since presumably it's running on the server anyway. You can communicate with the asp.net website via http from a php website if necessary (i.e. webservices). – James Gaunt Nov 01 '10 at 22:54
  • Because the website would already be built in PHP, but as its a large framework it would not be beneficial to switch and rebuild from scratch, and also hate how your constrained in ASP in certain aspects. – RobertPitt Nov 01 '10 at 22:58

1 Answers1

0

A strategy similar to JSON (or json itself)

break the objects down to strings and map it to a C# object. If you go with JSON it self you can get away with using some of the C# helpers already provided for translating Json.

Hope that helps.

Jake Kalstad
  • 2,045
  • 14
  • 20