Clan x86

Technical (Development, Security, etc.) => General Programming => Topic started by: 01Linux on July 08, 2005, 02:15:30 am

Title: Developing Multithreaded Applications
Post by: 01Linux on July 08, 2005, 02:15:30 am
Neat article on MSDN, http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetcomp/html/multithreaded_netcf_apps.asp
Title: Re: Developing Multithreaded Applications
Post by: rabbit on July 08, 2005, 10:10:07 am
Code: [Select]
public class thing extends Thread
{
    public static void thing()
    {
        super("thing");
        // blarg
    }
}
Java has had multi-thread simplicity for a LONG TIME.
Title: Re: Developing Multithreaded Applications
Post by: MyndFyre on July 08, 2005, 11:03:34 am
Yeah, threading in .NET is a cinch.

Of course in Java, you have to have a stupid extra worker class to support multithreading.  .NET supports function pointer (delegate) callbacks.  :)  Far superior, especially when you consider that they're type-safe at compile time.
Title: Re: Developing Multithreaded Applications
Post by: Tuberload on July 08, 2005, 03:23:45 pm
Yeah, threading in .NET is a cinch.

Of course in Java, you have to have a stupid extra worker class to support multithreading.  .NET supports function pointer (delegate) callbacks.  :)  Far superior, especially when you consider that they're type-safe at compile time.

Yes far superior if you're interested in running a bloated windows application only.  :P
Title: Re: Developing Multithreaded Applications
Post by: Warrior on July 08, 2005, 03:40:11 pm
Amen Tuberload, Amen.
Title: Re: Developing Multithreaded Applications
Post by: iago on July 08, 2005, 06:26:43 pm
Incidentally, there is less overhead to spawning a child process on Linux (using fork()) than there is spawning a thread on Windows.  I wish I had a source for that, but it's in a book I read a little while ago.

On Linux, a lot of things (particularly daemons) will fork when they get a request.  The child process (which can share memory with its parent, in an efficient way) handles the request and the main process goes back to listening.