Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Name a Thread


  • Please log in to reply
3 replies to this topic

#1 Bernie

Bernie

    Advanced Member

  • Members
  • PipPipPip
  • 40 posts

Posted 09 June 2013 - 06:49 PM

Is there any way to name a thread in the MF? Something like Thread.Name in the full size framework.

 

 



#2 ShVerni

ShVerni

    Advanced Member

  • Members
  • PipPipPip
  • 138 posts
  • LocationNew York, New York

Posted 09 June 2013 - 07:08 PM

I could be wrong, but it looks like that property doesn't exist in the MF:

 

http://msdn.microsof...y/hh435819.aspx

 

You can, of course, create a thread as a variable:

var foo = new Thread(bar);foo.Start();

But that may not be what you're looking for.



#3 Bernie

Bernie

    Advanced Member

  • Members
  • PipPipPip
  • 40 posts

Posted 09 June 2013 - 08:56 PM

I haven't been able to find one yet. But it's interesting that in Visual Studio is does show a field for name when you look in the thread window. I'm hoping that maybe someone has found a way around this.



#4 ziggurat29

ziggurat29

    Advanced Member

  • Members
  • PipPipPip
  • 244 posts

Posted 09 June 2013 - 09:14 PM

I'm pretty sure you can not set the thread name; that it's either not available in netmf, or at best would mean changing a build option of the firmware if it is capable.

 

In my case, I get around it by having my worker threads emit a log message identifying themselves by id.  Then at least I can correlate it in my logs.  E.g.

Debug.Print("XXX starting on thread: " + Thread.CurrentThread.ManagedThreadId);





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.