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. Advertisements

  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. Advertisements

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. Richard G
    Replies:
    0
    Views:
    507
    Richard G
    Jul 31, 2003
  2. =?Utf-8?B?Sm9uYXRoYW4gSG93YXJk?=

    ASP.NET Threadpool

    =?Utf-8?B?Sm9uYXRoYW4gSG93YXJk?=, Jan 24, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    702
    =?Utf-8?B?Sm9uYXRoYW4gSG93YXJk?=
    Jan 26, 2005
  3. Viorel Ghilas

    Impersonate in ThreadPool

    Viorel Ghilas, Feb 3, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    568
    Alvin Bruney [MVP]
    Feb 4, 2005
  4. =?Utf-8?B?SmltIEthbmU=?=

    ThreadPool

    =?Utf-8?B?SmltIEthbmU=?=, Aug 11, 2005, in forum: ASP .Net
    Replies:
    8
    Views:
    1,639
    Kevin Spencer
    Aug 11, 2005
  5. =?Utf-8?B?RGF2ZQ==?=

    ThreadPool problem

    =?Utf-8?B?RGF2ZQ==?=, Nov 1, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    1,481
    David Browne
    Nov 1, 2005
  6. Replies:
    3
    Views:
    1,245
    Samuel R. Neff
    Oct 17, 2007
  7. robert112
    Replies:
    1
    Views:
    815
    maciek kanski
    Jan 5, 2008
  8. Philipp Kraus

    threadpool and ui paint

    Philipp Kraus, May 13, 2014, in forum: Java
    Replies:
    6
    Views:
    407
    markspace
    May 13, 2014
Loading...