Ticket #1866 (new defect)

Bug contains 1 commit(s) | SVN Diffs for #1866

 

Opened 7 years ago

Fix RBT data sharing

Reported by: alan.liu(at)jtcsv.com Assigned to: andy
Priority: trivial Milestone: UNSCH
Component: transliterate Version: 2.0.1
Keywords: transliterate Cc:
Load: Xref: 2115, 2304
Java Version: Operating System: all
Project (C/J): ICU4C and ICU4J Weeks: 1
Review:

Description

Currently, RuleBasedTransliterator objects contain a Data object. The Data object may be shared by multiple instances. This is because, as originally conceived, the Data object is immutable. As of 2.0 this is no longer true because during a match operation an object such as a StringMatcher (contained in the Data object) may record state.

One solution is to abstract out the mutable data and hold it locally (it is only used within the dynamic scope of one match call). This is structurally awkward since the Data object contains an arbitrary tree of matchers and replacers, and any or all of the may hold state. Parallel trees would be required, or an elaborate state registration system.

Another solution is to acquire a lock for exclusive use of the Data object during the match operation. This is unappealing for performance reasons.

Another solution is to clone the Data object into each RBT rather than share them. This is clean but costs runtime memory. This is probably the best solution.

Attachments

Change History

12/31/69 18:27:02 changed by notes2

12/31/69 18:27:03 changed by auditor

  • 04/17/02 15:02:35 alan changed notes
  • 04/17/02 15:02:36 alan moved from incoming to transliterate
  • 07/31/02 19:14:00 schererm changed notes
  • 08/15/02 19:29:44 alan sent reply 1
  • 08/30/02 17:59:19 alan changed notes2
  • 08/30/02 17:59:19 alan changed notes
  • 08/30/02 18:25:24 hshih changed notes2
  • 08/30/02 18:25:24 hshih changed notes
  • 05/30/03 10:13:37 hshih changed notes2
  • 12/31/03 13:58:24 andy changed notes2
  • 01/15/04 17:26:41 alan changed notes2
  • 01/15/04 17:28:30 alan changed notes2
  • 01/15/04 17:30:18 alan sent reply 2
  • 02/05/04 15:58:47 alan changed notes2
  • 02/05/04 15:59:03 alan changed notes2
  • 08/26/04 09:36:14 grhoten changed notes2: assign: "alan" to "andy",

08/15/02 19:29:44 changed by Alan Liu <alan.liu(at)jtcsv.com>

This bug should be delayed until 2115 is fixed. When the latter is fixed, reassess this bug -- it can probably be closed then. (2115 will require a decoupling of mutable and immutable parts of an RBT rule object, so it will automatically fix this.)

01/15/04 16:30:18 changed by alanliu(at)us.ibm.com

If 2304 if fixed, it will subsume this bug. Recommendation: Fix 2304, then reassess these other fundamental bugs with the transliterator engine.


Add/Change #1866 (Fix RBT data sharing)




Anti spam check: