Results 1 to 40 of 113

Thread: VB Multithread Library (Generic Multithreading)

Threaded View

  1. #11
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: VB Multithread Library (Generic Multithreader)

    Krool, I don't have the deep understanding of multi-threading that you do. Is there reason why you need to RaiseEvent vs. an Implementation? The idea I was suggesting is something like this. It is rough, not polished:
    Code:
    ' new Interface to be used by customers. Let's say it's named: IThread
    Public Sub AsyncProcedure(ByVal SyncCallback As IThreadSyncCallback): End Sub
    Public Sub SyncCallback(ByRef Argument As Variant): End Sub
    
     ' the Thread.Cls
    add this: Private m_Consumer As IThread
    change Create to: Public Function Create(Owner As IThread) As Boolean
       Set m_Consumer = Owner ' validate that Nothing was not passed
    
     ' then instead of raising the two events, this:
             m_Consumer.SyncCallback Argument
    and   m_Consumer.AsyncProcedure SyncCallback
    
    add this in the Terminate event:
       Set m_Consumer = Nothing
    The caller would use: Implements IThread
    and then initiate with: BackgroundWorker.Create Me

    Edited: Many of the changes you make may break binary compatibility, unless you create new function names, i.e., CreateEx instead of modifying the Create function signature.
    Last edited by LaVolpe; Apr 23rd, 2017 at 11:01 AM.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width