473,320 Members | 2,071 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Switch beetwen threads

1
Does any body knows , how check the thread which differs from current?
I need to create the new thread and then kill parent thread from new one)
I use code like to run new form

Thread newthread = new Thread(new ThreadStart(createForm));
newthread.Start();
......................
static void createForm()
{
Application.Run(new Form1());

}
and then i need from the form kill the parent thread.
Thanks!
May 18 '07 #1
2 1924
weaknessforcats
9,208 Expert Mod 8TB
Create the parent thread as a Thread so you have the tread id to kill. By using the implicit "new Thread(new ThreadStart(createForm))" you have no way to refer to the thread "new ThreadStart(createForm)" directly.
May 19 '07 #2
AdrianH
1,251 Expert 1GB
Create the parent thread as a Thread so you have the tread id to kill. By using the implicit "new Thread(new ThreadStart(createForm))" you have no way to refer to the thread "new ThreadStart(createForm)" directly.
Which library is this from?


Adrian
May 20 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Carson | last post by:
Hi, I am now writing a c-code, which is extremely computational extensive. My computer is 2.8GHz Pentium (supports hyperthreading), using cygwin cc (latest version) to compile with the...
13
by: William Stacey | last post by:
Using the following code sample: public byte Get() { // <= Possible to switch Here?? lock(syncLock) { //Do something in Get(). } }
5
by: Nadav | last post by:
Hi, I am using FileStream's Async API: BeginRead/EndRead, upon completion callback execution I use the read data and call EndRead, Taking that in mind, I Wonder... does calling EndRead will cause...
14
by: Evan Camilleri | last post by:
I am going from VB.NET to c#. How can I do the following? switch x { case < 10: do something; break; case < 50: do something; break;
4
by: Ian Semmel | last post by:
I am doing a length operation reading access database and creating a sql database when I get this message. What am I supposed to do to get around it ? Thanks
1
by: arjun ch | last post by:
hai my friend i have one question diff beetwen vbexe and vb .NET exe Arjun *** Sent via Developersdex http://www.developersdex.com ***
13
by: Michael M. | last post by:
In Perl, it was: ## Example: "Abc | def | ghi | jkl" ## -"Abc ghi jkl" ## Take only the text betewwn the 2nd pipe (=cut the text in the 1st pipe). $na =~ s/\ \|(.*?)\ \|(.*?)\ \|/$2/g;...
6
by: Zoner | last post by:
Hey. This is my first post on this forum, and I'm just coming for a little help. I just started to teach myself Java yesterday, and i am having trouble writing a switch statement. The error: ...
28
by: Ryan Liu | last post by:
Hi, I have a client/server application, using one thread/client approach. I see very high context switch/sec. What are the ways to reduce it? Each thread sleep longer in its endless loop if...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.