It is currently Fri May 24, 2013 3:34 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 429 posts ]  Go to page Previous  1 ... 16, 17, 18, 19, 20, 21, 22 ... 29  Next
Author Message
 Post subject: Re: PureLVSORT library : sorting ListIconGadgets (and more)
PostPosted: Sat Dec 12, 2009 5:50 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Fri Apr 04, 2008 6:20 pm
Posts: 124
Location: Belgium
Fine, Master, Gnozal...
But now... Telle me why.. This part of code .
Code:
{=========   Boucle PRINCIPALE       ===============================================
; Initialise pour triage...
    PureLVSORT_SelectGadgetToSort(#Liste, #True)
    If PureLVSORT_SelectGadgetToSort(#Liste, #True) = #PureLVSORT_Ok
         For j=1 To Nb_Colonne       ;             Première ligne et première colonne... ENTETE
                  NomChamp$=TableFichier(1,j)    ;            Prise du nom d'entête
                       If FindString(NomChamp$,"Date",1)<>0   ; C'EST une date... Alors   
                  PureLVSORT_SetColumnType(#Liste, j-1, #PureLVSORT_DateDDMMYYHHMM) ; On fixe un format date pour le trie de cette colonne.
      Else                              ; #PureLVSORT_DateDDMMYYYY                   
               PureLVSORT_SetColumnType(#Liste, j-1, #PureLVSORT_String) ; default, not necessary
      EndIf
   Next j
    EndIf
    ;=============================================================================
    Repeat
   Event = WaitWindowEvent()
   If EventType() = #PB_EventType_LeftDoubleClick
      PureLVSORT_ClearGadget(#Liste)
   Else
         ...................

Work fine in other code... And here, I receive this F... Error---> "POLINK : Error... " ???
And aloso at this day I, dont now a relation of this error whith something... The linker ! Ok but wat ?
Please sorry for my english... I thing wthis some year, perhaps, one day... :wink:

If you can, you can answers in french... :roll:
Thanks,

_________________
Sorry for my english !


Top
 Profile  
 
 Post subject: Re: PureLVSORT library : sorting ListIconGadgets (and more)
PostPosted: Sat Dec 12, 2009 7:01 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Fri Apr 04, 2008 6:20 pm
Posts: 124
Location: Belgium
Sorry !!! :wink:
I receive the POLLINK Error ONLY With the IDE native... Withe JaPBe All is OK...
Now,why and where is the differnce between... JaPBe and the IDE From PB itselft ?
I suppose, JaPBe alway now where it is... And how do that wiht the IDE original !

_________________
Sorry for my english !


Top
 Profile  
 
 Post subject: Re: PureLVSORT library : sorting ListIconGadgets (and more)
PostPosted: Mon Dec 21, 2009 1:23 pm 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat Apr 26, 2003 8:27 am
Posts: 4231
Location: Strasbourg / France
GeBonet wrote:
Sorry !!! :wink:
I receive the POLLINK Error ONLY With the IDE native... Withe JaPBe All is OK...
Now,why and where is the differnce between... JaPBe and the IDE From PB itselft ?
I suppose, JaPBe alway now where it is... And how do that wiht the IDE original !

I assume you are using Threadsafe and/or Unicode mode ?
If so, you have to enable the corresponding subsystem (see PureLVSORT help, 'Unicode_Thread-safe' topic).

_________________
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).


Top
 Profile  
 
 Post subject: Re: PureLVSORT library : sorting ListIconGadgets (and more)
PostPosted: Mon Dec 21, 2009 5:39 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Fri Apr 04, 2008 6:20 pm
Posts: 124
Location: Belgium
You are right, now it's resolved...
And sorry for the disturb... :wink:
Tanks ! :D

_________________
Sorry for my english !


Top
 Profile  
 
 Post subject: IMA with MultiThreading & MultiCPU
PostPosted: Fri Apr 02, 2010 7:51 am 
Offline
User
User

Joined: Fri Feb 16, 2007 12:41 am
Posts: 16
Location: Paris, France
Hello,

I have a trouble with a the function PureLVSORT_SelectGadgetToSort() and PureCOLOR_SetGadgetColorEx() when I use it in a thread.
To test it, launch the simple application, and when it runs, move a window. On many PC multiCPU under XP you will have a invalid memory error on the instruction WaitWindowEvent(...
If you select only one CPU with the SetCPU_Affinity() or with the task manager of window the trouble doen't exist.

I would like to use all the power of my PC, if someone have an idea....


Code:
#Nb_Thread = 4
#Nb_Line = 10
#Nb_Colone = 40
#DELAY_FOR_SYSTEM = 1
#RGB_Interligne_list_CONTACT=$D1FCD3

#ALL_CPU = 0
#MSK_CPU_0 = $01
#MSK_CPU_1 = #MSK_CPU_0 <<1
#MSK_CPU_2 = #MSK_CPU_1 <<1
#MSK_CPU_3 = #MSK_CPU_2 <<1

Procedure SetCPU_Affinity(CPU.L)
  If CPU
    hProcess.L = GetCurrentProcess_ ()
    SetProcessAffinityMask_ (hProcess, CPU)
  EndIf 
EndProcedure 
 
Procedure test(i.L)
  ThrdWin.L = OpenWindow(#PB_Any, 0, 0, 690, 300, "ListIconGadget "+Str(i), #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
  LstIcon.L = ListIconGadget(#PB_Any,  10,  25, 680, 270, "Colonne ", 100)
  For i = 2 To #Nb_Colone
    AddGadgetColumn(LstIcon, i, "Colonne " + Str(i), GadgetWidth(LstIcon)/(#Nb_Colone+1))
  Next
  For i = 0 To #Nb_Line
    AddGadgetItem(LstIcon, i, Str(i))
  Next
  PureCOLOR_SetGadgetColorEx(LstIcon, #PureCOLOR_SystemColor, #PureCOLOR_SystemColor, #RGB_Interligne_list_CONTACT, #PureCOLOR_LV_AlternateColors)
  PureLVSORT_SelectGadgetToSort(LstIcon,#PureLVSORT_ShowClickedHeader_IconLeft)
 
  Repeat : Until WaitWindowEvent(#DELAY_FOR_SYSTEM) = #PB_Event_CloseWindow
 
  CloseWindow(ThrdWin)
EndProcedure


;- Main part
; Define how many CPU will run
SetCPU_Affinity(#ALL_CPU)  ; All cpu available
;SetCPU_Affinity(#MSK_CPU_0) ;only CPU_0

For i=1 To #Nb_Thread
  CreateThread(@test(),i)
Next 

test(0)
End


Top
 Profile  
 
 Post subject: Re: PureLVSORT library : sorting ListIconGadgets (and more)
PostPosted: Fri Apr 02, 2010 11:41 am 
Offline
Addict
Addict
User avatar

Joined: Thu Aug 07, 2003 7:01 pm
Posts: 2853
Location: United Kingdom
On PureBasic v4.50b2 I get 2 unresolved external symbol errors: 'pb_callfunctionfast6' and 'pb_callfunctionfast5'

_________________
http://www.SinisterSoft.com <- My Business website
http://www.ReportComplete.com and http://www.ReportPlus.co.uk <- School end of term reports system


Top
 Profile  
 
 Post subject: Re: PureLVSORT library : sorting ListIconGadgets (and more)
PostPosted: Sat Apr 03, 2010 5:43 pm 
Offline
User
User

Joined: Mon Aug 20, 2007 6:03 pm
Posts: 20
Location: Germany
Me too.
PureLVSORT_SetColumnType works, but PureLVSORT_SelectGadgetToSort returns unresolved external symbol errors.
Could you please recompile that library for PureBasic 4.50 Beta 2?


Top
 Profile  
 
 Post subject: Re: PureLVSORT library : sorting ListIconGadgets (and more)
PostPosted: Tue Apr 06, 2010 11:43 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Wed Apr 30, 2003 8:15 am
Posts: 710
Location: Germany
+1

... btw. where is gnozal?????

_________________
"Daddy, I'll run faster, then it is not so far..."


Top
 Profile  
 
 Post subject: Re: IMA with MultiThreading & MultiCPU
PostPosted: Wed Apr 07, 2010 12:33 pm 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat Apr 26, 2003 8:27 am
Posts: 4231
Location: Strasbourg / France
Do you compile with the threadsafe switch ?

_________________
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).


Top
 Profile  
 
 Post subject: Re: PureLVSORT library : sorting ListIconGadgets (and more)
PostPosted: Wed Apr 07, 2010 12:36 pm 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat Apr 26, 2003 8:27 am
Posts: 4231
Location: Strasbourg / France
dige wrote:
+1
... btw. where is gnozal?????

I just came back from a trip, have a lot of work, so this PB4.50 thing will have to wait a little.

_________________
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).


Top
 Profile  
 
 Post subject: Re: IMA with MultiThreading & MultiCPU
PostPosted: Wed Apr 07, 2010 10:17 pm 
Offline
User
User

Joined: Fri Feb 16, 2007 12:41 am
Posts: 16
Location: Paris, France
Yes, I compile with the switch theadsafe. If I try to run the application with switch threadsafe off, the "Invalid memory error" comes immedialtely.

I make the test on diferent PC
PC with only one core Mobile centrino under XP SP2: No trouble
* Pentium 4 (monocore with multitreading active) under XP SP2 and SP3: Trouble
* Dual core under XP SP3: Trouble
* Quad core under XP SP3: Trouble
* I7-860 under Window 7 ultimate: No trouble
I don't do any test on PC with AMD processor.

I would like to know if someone who test my code have the same trouble.


Top
 Profile  
 
 Post subject: Re: IMA with MultiThreading & MultiCPU
PostPosted: Thu Apr 08, 2010 11:02 am 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat Apr 26, 2003 8:27 am
Posts: 4231
Location: Strasbourg / France
JJ wrote:
Yes, I compile with the switch theadsafe. If I try to run the application with switch threadsafe off, the "Invalid memory error" comes immedialtely.
Then I guess the library isn't 100% threadsafe.
I simply compile the library with the threadsafe option, without any further changes.
Anyway, I am not sure that it's very safe to manipulate gadgets in threads. Maybe you should add semaphores to your code ?

_________________
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).


Top
 Profile  
 
 Post subject: Re: IMA with MultiThreading & MultiCPU
PostPosted: Thu Apr 08, 2010 5:36 pm 
Offline
User
User

Joined: Fri Feb 16, 2007 12:41 am
Posts: 16
Location: Paris, France
I think this 2 procedure PureLVSORT_SelectGadgetToSort() and PureCOLOR_SetGadgetColorEx() must used callback procedure.
If I don't use this procedure, my application runs fine. Many other procedure in the library PureColor works fine too in this context.

I make the test with semaphore to protect the WaitWindowEvent(), it reduce the risk of crash but the risk is not null. And the performance are very bad.

When I try to fix this trouble, the only solution that I find, is to limited the application to run on only one CPU. This is the best solution for the moment, but I continue to have around 1 crash up 20 hours running.


Top
 Profile  
 
 Post subject: Re: PureLVSORT library : sorting ListIconGadgets (and more)
PostPosted: Mon Apr 12, 2010 3:57 pm 
Offline
User
User

Joined: Mon Aug 20, 2007 6:03 pm
Posts: 20
Location: Germany
Thanks for your update to 4.5x. Unfortunately I still get this POLINK errors:
Code:
POLINK: error: Unresolved external symbol '_PB_StringBasePosition'.
POLINK fatal error: 1 unresolved external(s).


I am using PureBasic 4.50 Beta 2 x32

Did someone have the same problem with the new PureLVSort library?


Top
 Profile  
 
 Post subject: Re: PureLVSORT library : sorting ListIconGadgets (and more)
PostPosted: Mon Apr 12, 2010 4:27 pm 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat Apr 26, 2003 8:27 am
Posts: 4231
Location: Strasbourg / France
PBUser wrote:
Thanks for your update to 4.5x. Unfortunately I still get this POLINK errors:
Code:
POLINK: error: Unresolved external symbol '_PB_StringBasePosition'.
POLINK fatal error: 1 unresolved external(s).
Probably a subsystem issue.
PureLVSORT.chm wrote:
This library exists in several versions :
- the standard version, located in %Purebasic%\PureLibraries\UserLibraries\ ;
- the thread-safe version, located in %Purebasic%\SubSystems\UserLibThreadSafe\PureLibraries\ .
- the unicode version, located in %Purebasic%\SubSystems\UserLibUnicode\PureLibraries\ .
- the unicode + thread-safe version, located in %Purebasic%\SubSystems\UserLibunicodeThreadSafe\PureLibraries\ .
In order to use this library in thread-safe mode (compiler option /THREAD), you have to enable the subsystem 'UserLibThreadSafe' in the PB IDE, or add '/SUBSYSTEM UserLibThreadSafe' to the PBCompiler arguments.
In jaPBe, do nothing : it will automatically enable the 'UserLibThreadSafe' subsystem to use the threadsafe versions of the installed userlibraries.
It's the same logic for unicode and unicode + thread-safe modes.

_________________
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 429 posts ]  Go to page Previous  1 ... 16, 17, 18, 19, 20, 21, 22 ... 29  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye