Async Beginer help

  • 14 years ago

    Hi, I am writing some code that needs to process very quickly, during this process I need to log actions & its progress.

    I am new to async (multi threading) & wanted some help creating a log function that can be called from my main code loop so it wouldn't slow it down.

    Can anyone point me in the direction of a good article that has a real world example of how to create an async function & pass in parameters (or post code)?

    example of what i am trying to do:

    Public Sub DoSomeWork()

    for each item as Object in AListOfObjects
        '//Do some processing with this object
        SharedObject.WriteToLog("Object #" & Object.Id.ToString,"status","OK")
        '// prehaps some more code
    Next
    '// perhaps some more code here too
    End Sub

    'In a global shared class
    Public Shared Sub WriteToLog(objectId as string, status as string,result as string)
    '// this call needs to be async so the calling code can continue without having to wait for this to complete
    End Sub

    Any help is much appreciated. Big Smile [:D]


























Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Programs must be written for people to read, and only incidentally for machines to execute.”