[Gambas-user] New feature with Task component

Olivier Cruilles olivier.cruilles at ...614...
Sun Jul 20 16:12:10 CEST 2014


In the TASK, I just do that:


PRINT data1 & ";" & data2 & ";" & data3 & ";" & data4       '   In a For Each loop

Ex:  PRINT "127.0.0.1;3413;7834;57661510"


In the parent process:


Public sUDPServer_READ(Data as string)

DIM Champs as String[]
DIM ListLigne as String[]


ListLigne = split(Data, "\", "'")

For each LigneData in ListLigne

      Champs = split(LigneData, ";" , "'")               ' This part take 7 to 12 microseconds
      ModFunction.StoreData(Champs[0], Champs[1], Champs[2], Champs[3])

Next

End



Cordialement,

Olivier Cruilles
EMail: olivier.cruilles at ...614...
Portable: +01 514 431 2960

Le 20 juil. 2014 à 09:45, Benoît Minisini <gambas at ...1...> a écrit :

> Le 20/07/2014 15:21, Olivier Cruilles a écrit :
>> Hello Benoit,
>> 
>> I'm building an application that is a UDP Server to receive and
>> decompilate network flow.
>> 
>> To not lose UDP sequence, the main process of this application need
>> to be the most fast possible. So in this case, when a READ event of
>> the USPServer raise, I just catch it as string directly from the
>> stream and I store it in a string[] variable.
>> 
>> All this part is very fast and work fine.
>> 
>> Next, every 400ms, with a timer, I check if there is something in the
>> string[] variable and a I extract a part of strings to send it to a
>> TASK to decompilate all these flows in background. All the TASK work
>> fine but to store the result of the decompilation of all these flows
>> by the TASK, I have no another choice to use the PRINT command inside
>> the TASK, by serialization/deserialisation, with the parent process.
>> So all that is good but with this methode I take between 7 to 12
>> microseconds to deserialise the informations from the TASK in the
>> READ event in the parent process. In my case this is time I loose for
>> the READ event of the UDPServer and I loose Network sequence.
>> 
>> I try to execute from the TASK a function in isolate Class in the
>> application but not data are stored in any variables. I read again
>> the documentation and all that is normal for a TASK. All the
>> modifications made by the TASK process are not visible by the parent
>> process.
>> 
>> My question is, could you add possibility to store data in common
>> variables from any TASK (in my case an array of Classes) just to
>> bypass the serialization/deserialization normal process between TASK
>> and his parent ?
>> 
>> To have an idea, I receive more than 700 millions of Flows each day
>> so this some microseconds are very important in the end.
>> 
>> Thank in advance
>> 
>> 
>> 
>> Cordialement,
>> 
>> Olivier Cruilles EMail: olivier.cruilles at ...614...
>> 
> 
> I don't want to share things (Gambas objects) between a task and its 
> parent process, indirectly because the interpreter is not thread-safe, 
> and I don't want it to support threading.
> 
> How do you serialize/unserialize the data coming from the task? Are you 
> sure you cannot optimize it?
> 
> -- 
> Benoît Minisini
> 
> ------------------------------------------------------------------------------
> Want fast and easy access to all the code in your enterprise? Index and
> search up to 200,000 lines of code with a free copy of Black Duck
> Code Sight - the same software that powers the world's largest code
> search on Ohloh, the Black Duck Open Hub! Try it now.
> http://p.sf.net/sfu/bds
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user





More information about the User mailing list