Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[C#] Threads

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Sneak
Grandmaster Cheater Supreme
Reputation: 0

Joined: 05 Nov 2008
Posts: 1895

PostPosted: Thu Dec 10, 2009 3:28 pm    Post subject: [C#] Threads Reply with quote

Can somebody give me a rundown and example of threads in C#?
_________________
Back to top
View user's profile Send private message
Flyte
Peanuts!!!!
Reputation: 6

Joined: 19 Apr 2006
Posts: 1887
Location: Canada

PostPosted: Thu Dec 10, 2009 4:21 pm    Post subject: Reply with quote

Don't try to run before you can walk (or I guess in this case, walk before you can crawl). I'm relatively certain you just learned how to call a class method a week or two ago.
Back to top
View user's profile Send private message
Sneak
Grandmaster Cheater Supreme
Reputation: 0

Joined: 05 Nov 2008
Posts: 1895

PostPosted: Thu Dec 10, 2009 9:05 pm    Post subject: Reply with quote

yeah I think so too xD. I just Dled a source with Multi Threading, and it looks complicated :X
_________________
Back to top
View user's profile Send private message
marryjohnson
How do I cheat?
Reputation: 0

Joined: 11 Dec 2009
Posts: 7

PostPosted: Sat Dec 12, 2009 6:59 am    Post subject: Reply with quote

Example of Thread

ThreadSample.cs
using System;
using System.Threading;

namespace Suite101.CSharp
{
public class ExampleThreads
{
public static void Main()
{
ExampleThreads sample = new ExampleThreads();
sample.CreateThreads();
}

public void CreateThreads()
{
Thread firstThread = new Thread( new ThreadStart( FirstEntryPoint ) );
Thread secondThread = new Thread( new ThreadStart( SecondEntryPoint ) );

firstThread.Start();
secontThread.Start();
}

public void FirstEntryPoint()
{
// Do Nothing
}

public void SecondEntryPoint()
{
// Do Nothing
}
}
}

_________________
memory cards
Back to top
View user's profile Send private message Send e-mail
Sneak
Grandmaster Cheater Supreme
Reputation: 0

Joined: 05 Nov 2008
Posts: 1895

PostPosted: Sun Dec 13, 2009 11:31 am    Post subject: Reply with quote

ooh thank you.
_________________
Back to top
View user's profile Send private message
iPromise
Grandmaster Cheater
Reputation: -1

Joined: 27 Jun 2009
Posts: 529
Location: Canada

PostPosted: Sun Dec 13, 2009 12:14 pm    Post subject: Reply with quote

Example:

Code:

#include <windows.h>
#include <iostream>

using namespace std;

bool InputMessage()
{
   while (1)
   {
      MessageBoxA(0, "iPromise", "iPromise", MB_OK);
      Sleep(10);
   }

   return true;
}

void main()
{
   CreateThread(0, 0, (LPTHREAD_START_ROUTINE) InputMessage(), 0, 0, 0);
   cin.get();
}
Back to top
View user's profile Send private message MSN Messenger
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Sun Dec 13, 2009 1:22 pm    Post subject: Reply with quote

iPromise wrote:
Example:

Code:

#include <windows.h>
#include <iostream>

using namespace std;

bool InputMessage()
{
   while (1)
   {
      MessageBoxA(0, "iPromise", "iPromise", MB_OK);
      Sleep(10);
   }

   return true;
}

void main()
{
   CreateThread(0, 0, (LPTHREAD_START_ROUTINE) InputMessage(), 0, 0, 0);
   cin.get();
}

That is a horrible example of multithreading/concurrency
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Sun Dec 13, 2009 6:25 pm    Post subject: Reply with quote

iPromise wrote:


he asks for help in C# and you go ahead and post the worst example possible in another language. Neutral
Back to top
View user's profile Send private message
Flyte
Peanuts!!!!
Reputation: 6

Joined: 19 Apr 2006
Posts: 1887
Location: Canada

PostPosted: Sun Dec 13, 2009 6:59 pm    Post subject: Reply with quote

slovach wrote:
iPromise wrote:


he asks for help in C# and you go ahead and post the worst example possible in another language. Neutral


The best part is, is that it isn't even multi-threaded. Instead of passing a function pointer, he calls the function. Laughing
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites