Re: About ThreadPool.QueueUserWorkItem and ThreadPool.RegisterWaitForSingleObject

Discussion in 'ASP .Net' started by Scott Allen, Dec 13, 2004.

  1. Scott Allen

    Scott Allen Guest

    That's correct, Henri.

    --
    Scott
    http://www.OdeToCode.com/blogs/scott/

    On Mon, 13 Dec 2004 16:41:28 +0100, "Henri" <>
    wrote:

    >Thanks,
    >So the new object will be instantied by the main thread, and MyCallBack will
    >then be processed by another thread from the threadPool, right?
    >
    >Henri
    >
    >"Henri" <> a écrit dans le message de
    >news:%...
    >> Might sound a stupid question but need to be sure:
    >>
    >> When you call ThreadPool.QueueUserWorkItem and
    >> ThreadPool.RegisterWaitForSingleObject passing a New object as state
    >>
    >> e.g.: ThreadPool.QueueUserWorkItem(AddressOf MyCallBack, New
    >> MyObject(myArg1, myArg2))
    >>
    >> the new object MyObject is instantiated just before QueueUserWorkItem is
    >> called, and not just before MyCallBack is called, isn't it?
    >> It's the same for RegisterWaitForSingleObject, isn't it?
    >>
    >> Thanks
    >>
    >> Henri
    >>
    >>
    >>
    >>
    >>

    >
    >
     
    Scott Allen, Dec 13, 2004
    #1
    1. Advertising

  2. Scott Allen

    Henri Guest

    Thanks for your answers Scott :) !

    "Scott Allen" <bitmask@[nospam].fred.net> a écrit dans le message de
    news:...
    > That's correct, Henri.
    >
    > --
    > Scott
    > http://www.OdeToCode.com/blogs/scott/
    >
    > On Mon, 13 Dec 2004 16:41:28 +0100, "Henri" <>
    > wrote:
    >
    > >Thanks,
    > >So the new object will be instantied by the main thread, and MyCallBack

    will
    > >then be processed by another thread from the threadPool, right?
    > >
    > >Henri
    > >
    > >"Henri" <> a écrit dans le message de
    > >news:%...
    > >> Might sound a stupid question but need to be sure:
    > >>
    > >> When you call ThreadPool.QueueUserWorkItem and
    > >> ThreadPool.RegisterWaitForSingleObject passing a New object as state
    > >>
    > >> e.g.: ThreadPool.QueueUserWorkItem(AddressOf MyCallBack, New
    > >> MyObject(myArg1, myArg2))
    > >>
    > >> the new object MyObject is instantiated just before QueueUserWorkItem

    is
    > >> called, and not just before MyCallBack is called, isn't it?
    > >> It's the same for RegisterWaitForSingleObject, isn't it?
    > >>
    > >> Thanks
    > >>
    > >> Henri
    > >>
    > >>
    > >>
    > >>
    > >>

    > >
    > >

    >
    >
     
    Henri, Dec 14, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. bruce barker

    Re: ThreadStaticAttribute and threadpool

    bruce barker, Jul 11, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    507
    bruce barker
    Jul 11, 2003
  2. David Browne

    Re: ThreadStaticAttribute and threadpool

    David Browne, Jul 11, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    442
    David Browne
    Jul 11, 2003
  3. Douwe
    Replies:
    0
    Views:
    722
    Douwe
    Dec 8, 2005
  4. Replies:
    3
    Views:
    1,089
    Samuel R. Neff
    Oct 17, 2007
  5. robert112
    Replies:
    1
    Views:
    672
    maciek kanski
    Jan 5, 2008
Loading...

Share This Page