🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internet.socket
Article #5619

Re: Blocking Sockets and Synconize

#5619
From: mike
Date: Tue, 27 Jul 2004 14:29
44 lines
2408 bytes
Remy,

Thanks for your response, allways appreciated.

Just for my understanding, what are the possible effects of not using
Syncronize in a thread.

Thanks

Mike

"Remy Lebeau (TeamB)" <gambit47.no.spam@no.spam.yahoo.com> wrote in message
news:410413c0$1@newsgroups.borland.com...
>
> "mike" <mfbrowne@earthlink.net> wrote in message
> news:4103c5b6$1@newsgroups.borland.com...
>
> > Could someone clarify my understanding of when
> > to use Syncronize in a blocking thread.
>
> Call Synchronize() whenever you want to make a serialized call, meaning
that
> a given block of code is only called by one thread at a time instead of in
> parallel simultaneously.  This is particularly important to do when a
thread
> wants to access the main thread's GUI, for instance.
>
> > I understand that when doing anything with a form then
> > I should use Syncronize, but the question I have is if I am
> > using a Data Module to access a database should I also
> > use Syncronize.
>
> In general, yes.  However, some databases support multi-threaded sessions,
> so if you are using such a database, then you can give each thread its own
> session object and they will have the database synchronizing for your
> internally.  The alternative is to make a dedicated database thread and
then
> have your other threads post requests to that thread, so that only one
> actual thread is ever accessing the database.
>
>
> Gambit
>
>
Technical Details
Message-ID: <410666d6$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!news-FFM2.ecrc.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <4103c5b6$1@newsgroups.borland.com> <410413c0$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,98e571834798f748
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "mike" <mfbrowne@earthlink.net>
Newsgroups: borland.public.cppbuilder.internet.socket
References: <4103c5b6$1@newsgroups.borland.com> <410413c0$1@newsgroups.borland.com>
Subject: Re: Blocking Sockets and Synconize
Date: Tue, 27 Jul 2004 10:29:10 -0400
Lines: 46
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 68.204.190.196
Message-ID: <410666d6$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1090938582 68.204.190.196 (27 Jul 2004 07:29:42 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!news-FFM2.ecrc.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail