Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. Threading help?

Threading help?

Scheduled Pinned Locked Moved C#
helptutorialquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    eric_tran
    wrote on last edited by
    #1

    Hi everyone, Please help me How to pass this ArrayList to a thread as an parameter. Thread thread1 = new Thread(new ThreadStart()); thread1.Start(); ArrayList space = new ArrayList(); for (int i = 1; i <= 10 ; i++) { space.Add(i); } eric

    R 1 Reply Last reply
    0
    • E eric_tran

      Hi everyone, Please help me How to pass this ArrayList to a thread as an parameter. Thread thread1 = new Thread(new ThreadStart()); thread1.Start(); ArrayList space = new ArrayList(); for (int i = 1; i <= 10 ; i++) { space.Add(i); } eric

      R Offline
      R Offline
      Robin Panther
      wrote on last edited by
      #2

      You could try to use System.Threading.ParameterizedThreadStart instead of ThreadStart if you are using .NET 2.0. If not - declare your ArrayList on class level (not inside function), and just call it from your thread... but be carefull to avoid cross-threading problems... ____________________________________________ Robin Panther http://www.robinland.com

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups