Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(103)

Issue 5380002: cashew: defer all D-Bus signal processing to main loop (Closed)

Created:
10 years ago by Vince Laviano
Modified:
9 years ago
Reviewers:
Daniel Kurtz
CC:
chromium-os-reviews_chromium.org, Vince Laviano, Jason Glasgow
Visibility:
Public.

Description

cashew: defer all D-Bus signal processing to main loop Avoid libdbus-c++ deadlock issues with sending dbus messages in dbus signal callbacks by doing as little as possible in these callbacks. Instead, have the callbacks schedule dbus signal processing to be done later from the main loop. This blanket deferral should be simpler and more robust than trying to defer specific actions such as Service deletion as we've done in previous CLs. BUG=chromium-os:8892 TEST=unit tests, manual testing on device (suspend/resume while connected to 3G) Change-Id: I05e9026f2ad253d503d6de702b108a4d261237de Committed: http://chrome-svn/viewvc/chromeos?view=rev&revision=0f4972d

Patch Set 1 #

Total comments: 9
Unified diffs Side-by-side diffs Delta from patch set Stats (+319 lines, -32 lines) Patch
M src/Makefile.am View 1 chunk +2 lines, -0 lines 0 comments Download
M src/cashew_server.h View 3 chunks +7 lines, -1 line 0 comments Download
M src/cashew_server.cc View 1 chunk +5 lines, -2 lines 0 comments Download
M src/device.h View 4 chunks +15 lines, -1 line 0 comments Download
M src/device.cc View 2 chunks +16 lines, -0 lines 0 comments Download
M src/main.cc View 4 chunks +5 lines, -2 lines 0 comments Download
A src/property_changed_handler.h View 1 chunk +82 lines, -0 lines 0 comments Download
A src/property_changed_handler.cc View 1 chunk +73 lines, -0 lines 9 comments Download
M src/service.h View 4 chunks +15 lines, -2 lines 0 comments Download
M src/service.cc View 2 chunks +16 lines, -0 lines 0 comments Download
M src/service_manager.h View 7 chunks +35 lines, -4 lines 0 comments Download
M src/service_manager.cc View 5 chunks +48 lines, -20 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
Vince Laviano
Here's the first cut at my revamped CL to address the libdbus-c++ deadlock issue. It ...
10 years ago (2010-11-25 03:28:39 UTC) #1
Daniel Kurtz
http://codereview.chromium.org/5380002/diff/1/src/property_changed_handler.cc File src/property_changed_handler.cc (right): http://codereview.chromium.org/5380002/diff/1/src/property_changed_handler.cc#newcode33 src/property_changed_handler.cc:33: source_id_ = g_idle_add(StaticOnPropertyChangedCallback, this); I don't know how well ...
10 years ago (2010-11-29 05:20:17 UTC) #2
Vince Laviano
Daniel: Thanks for taking a look at the CL. Ping me if you want to ...
10 years ago (2010-11-29 20:13:07 UTC) #3
Daniel Kurtz
10 years ago (2010-11-29 21:52:08 UTC) #4
LGTM w/ one small potential future optimization to investigate.

http://codereview.chromium.org/5380002/diff/1/src/property_changed_handler.cc
File src/property_changed_handler.cc (right):

http://codereview.chromium.org/5380002/diff/1/src/property_changed_handler.cc...
src/property_changed_handler.cc:33: source_id_ =
g_idle_add(StaticOnPropertyChangedCallback, this);
OK I agree since it is all single-threaded.

http://codereview.chromium.org/5380002/diff/1/src/property_changed_handler.cc...
src/property_changed_handler.cc:63: handler->source_id_ = 0;
OK I agree since it is all single-threaded.

http://codereview.chromium.org/5380002/diff/1/src/property_changed_handler.cc...
src/property_changed_handler.cc:64: return FALSE;
OK I agree, if creating a new idle handler on each message has negligible
overhead, and there is no easy way to just attach/remove a single pre-created
idle handler.

Powered by Google App Engine
This is Rietveld 408576698