That's indeed how I saw it work on the G1.

However, i think you cannot assume anything. If you write a content-
provider, it can be bound by any process.

This causes me to believe that it can be called by several threads at
the same time.

Just to be sure, synchronize where necessary, depending on how you
implement your content-provider.

On Jun 18, 4:39 pm, Marco Nelissen <marc...@android.com> wrote:
> On Thu, Jun 18, 2009 at 1:24 PM, Daniel 
> <daniel.himmel...@googlemail.com>wrote:
>
>
>
> > I am currently writing an app that asynchronously populates a
> > ListActivity. Therefore the query on my ContentProvider is done by a
> > separate thread, not the UI thread. Furthermore the ContentProvider is
> > synchronized by a service in the background. Since this may be a
> > lengthy operation the service also uses its own thread.
> > My question now is: Do I have to do some locks by myself to support
> > concurrent accesses by both reader and writer (in the ContentProvider)
> > or is there already taken care of when inheriting from ContentProvider
> > and implementing the methods?
>
> ContentProvider itself doesn't do any locking like that, though if you're
> using a SQLite database as your data store, you kind of get the locking for
> free, since SQLiteDatabase does locking where needed (i.e. it locks the
> database for exclusive access when you do an insert, delete or update).
>
> > Which thread runs a ContentProvider? Some Binder thread or the calling
> > thread?
>
> If your content provider runs in the same process as your application, then
> I think it's the calling thread.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to